Please enable JavaScript.
Coggle requires JavaScript to display documents.
ICT ch.3 mind map - Coggle Diagram
ICT ch.3 mind map
3.3 Number Representation in Computer Systems
Binary number system
The ONLY number system that a computer uses in storing numbers and performing arithmetic.
Bit, Byte and Word
Bit
A single binary digit
The basic unit for storing data in a computer
A single bit can only represent any one of two distinct
values. For example: 0 or 1, True or False, On or Off
If more distinct values need to be represented, a series of bits can be used. For example: A 8-bit binary number can hold 256 distinct values.
An n-bit binary number can represent 2^n distinct values.
Byte
A data unit used in computers
Consists of 8 bits and is the smallest addressable unit in a
microprocessor.
Word
Modern computers can handle data stored in two or more bytes at a time.
The natural unit of data used by a computer is called a word.
The word length (word size) is measured in bits.
Modern computers usually have a
word length of 16, 32 or 64 bits.
Conversion of unit
The difference of each unit is 2^10( 1024 ) times.
Unit is from small to large.
÷
Unit is from large to small.
x
Representation of unsigned binary
integer
Unsigned integer is a type of integer representation that contains no sign symbol.
Non-negative integers integers such as population and sales volume of books can be represented by unsigned integers.
Representation of signed binary integer
sign-and-magnitude
The leftmost bit, known as sign bit, is used to specify the sign of a binary integer.
the sign bit:
0: a
positive
integer
1: a
negative
integer
The shortfall is that there are two representations of zero: Both 1000 00002 and 0000 00002 represent zero in an 8-bit signed binary integer. - It is rarely used in computer systems.
Two's complement
Widely used in computers to represent binary integers
All integers have unique representations.
Representation of a positive binary integer is exactly the same as that of the original value
To get a positive binary integer:
Starting from the corresponding positive binary integer, invert all bits from ‘0’ to ‘1’ and ‘1’ to ‘0’ . The result is known as
one’s complement.
Add 1 to the one’s complement.
The above steps can also be used to convert a negative binary integer into a positive binary integer.
Evaluate the two’s complement representation of -1310in an 8-bit memory unit. 8-bit binary representation of 1310 = 0000 11012
One’s complement of -1310 = 1111 00102
Two’s complement of -1310 = 1111 00112
Evaluate the two’s complement representation of -12710in an 8-bit memory unit.
8-bit binary representation of 12710 = 0111 11112
One’s complement of -12710 = 1000 00002
Two’s complement of -12710 = 1000 00012
Evaluate the two’s complement representation of 2710in an 8-bit memory unit.
8-bit binary representation of 2710 =
0001 1011__
One’s complement of -2710 =
1110 0100__
Two’s complement of -2710 =
1110 0101
Evaluate the two’s complement representation of -10010in an 8-bit memory unit.
8-bit binary representation of 10010 = 0110 0100
One’s complement of -10010 = 1001 1011
Two’s complement of -10010 = 1001 1100
3.4 Addition and Subtraction of Different Number Representations v
The calculation on both addition and subtraction of unsigned integers in other number systems is the same as that in the denary system.
A ‘carry’ is generated when the sum of digits equals or exceeds the base value.
A ‘borrow’ from the left digit is necessary if a larger digit is subtracted from a smaller one.
Overflow Error
Occur when the calculation result is outside the range that the digits can represent. For example:
3.5 Character Coding Systems
Other than numeric data, a computer needs to store and process characters.
The character coding system is a way to represent characters in a form that can be manipulated efficiently in a computer
Character coding systems
Two common character coding systems:
American Standard Code for Information Interchange(ASCII)
Extended Binary-Coded Decimal Interchange Code (EBCDIC)
Each code represents either a printable character or a non-printable character (e.g. end-of-line character)
Each ASCII character consists of 7 bits and it can contain
2^7 (i.e. 128) different characters.
They include all the alphanumeric characters (the small and capital English letters, digits from 0 to 9) and graphics symbols.
Chinese Character Coding Systems
The standard ASCII: 128 characters
The extended ASCII: 256 characters
There are more than 100000 Chinese characters and we use more than 10,000 of them in our daily lives.
Chinese characters are usually represented in:
Big5 code: traditional Chinese
Guo Biao (GB) code: simplified Chinese
Unicode
Both character coding systems use two bytes to represent one Chinese character. - If a Chinese text file is processed with the wrong coding system, strange and meaningless characters will appear.
Unicode
Used to represent all the existing
languages in the world
Contain about
100000 characters
The representations of Unicode known as code points are variable in length.
Made up of one to four bytes
The code points are carefully defined so that the most frequently used characters, such as
the the ASCII codes, are put at the front of the code table.
These characters can be represented by a one-byte code point.