计算机导论 Introduction to Computer

时间:2021-10-08
本文章向大家介绍计算机导论 Introduction to Computer,主要包括计算机导论 Introduction to Computer使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

Overview

In this course we mainly learned about :

  • Two Architectures of Computer : von Neumann and Harvard
  • Binary, Octal and Hexadecimal
  • Representation of numbers: Sign-Magnitude, Ones' Complement and Two's complement

一、Two Architectures of Computer

There are two types of computer architectures. They regulate the composition of computers.

1. von Neumann Architecture

According to this architecture, a computer has three basic units:

  • Central Processing Unit: contains Control Unit and Arithmetic Unit
  • Main Memory Unit
  • Input/Output Device

In this architecture, data and instructions share the memory.

2. Harvard Architecture

Unlike von Neumann architecture, data and instructions have their own memory.

二、Binary Octal Hexadecimal

Because of the characteristic of logic circuits, computer uses binary to represent all data.

But in order to help developers write and memorize data, we also use octal and hexadecimal to represent data.

Sometimes we need to convert them to each other.

三、原码、反码、补码

For a number, the computer must encode it and then store it.

There are three encoding methods: Sign-Magnitude, Ones' Complement, Two’s Complement

1. Sign-Magnitude

Sign and Magnitude, as the name implies.

  • The first bit represent sign of the number: 0 for positive, 1 for negative.

  • The remaining bits represent the magnitude of the number in binary.

2. Complement

Since Binary number system has only 2 digits (0 and 1), the complement of one digit is the other.

1) One's Complement

  • One’s Complement of a positive number is itself
  • One’s Complement of a negative number is based on its sign-magnitude, with the sign bit unchanged, and the remaining bits inverted.

2) Two's Complement

It's similar to One's Complement.

The main difference is that when the number is negative, 1 is added to the last after getting the complement.

We use two's complement to simplify the calculation. So that we don't need to specifically deal with sign bit.

原文地址:https://www.cnblogs.com/danielwong2021/p/15380780.html