Chapter 1: Digital Systems and Binary Numbers
Chapter 1: Digital Systems and Binary Numbers
• Digital systems:
e.g.
– digital camera
an-1… a5a4a3a2a1a0.a1a2a3… aj
Decimal point
Power
Example:
Coefficient: aj = 0 to r 1
Note: Special Powers of 2
Ex : (780.75)10 ( )16 =( )2 ( )8
Ex : ( )10 ( BCD.03)16 =( )2 ( )8
Ex : ( )10 ( )16 =( 1101.011)2 ( )8
Complements of Numbers
There are two types of complements for each base-r system: the radix complement and
diminished radix complement.
the r's complement and the second as the (r 1)'s complement.
Example: Base-10
9' s 10' s
375 ( ) ( )
9' s 10' s
475.897 ( ) ( )
Example: Base-2
1' s 2' s
(1011011) ( ) ( )
1' s 2' s
(10111.0111) ( ) ( )
Signed Binary Numbers
It is customary to represent the sign with a bit placed in the leftmost position of the
number.
§ The convention is to make the sign bit 0 for positive and 1 for negative.
§ Example: Although there is only one way to represent +9, there are three
different ways to represent -9 with eight bits:
Signed Binary Numbers
Table 3 lists all possible four-bit signed binary numbers in the three representations.
Signed Binary Numbers
For a n-bit signed binary system, the numerical range is
Ex: Use 2’s complement to find the answers of the following questions.
(8 bits) (1)49 35 (2)37 45
(3)-37-(-45) (4) 37-(-66)
Sol:
Overflow: signed binary number
Binary Codes
Binary Codes
Example:
Consider decimal 185 and its corresponding value in BCD and binary:
■ BCD Addition
Binary Codes
Example:
Consider the addition of 184 + 576 = 760 in BCD:
■ Decimal Arithmetic
Other Decimal Codes
Gray Codes
ASCII Character Codes
• Some non-printing characters are used for text format (e.g. BS = Backspa
ce, CR = carriage return)
• Other non-printing characters are used for record marking and flow control
(e.g. STX and ETX start and end text areas).
ASCII Character Codes
ASCII Properties
Fig. 1.5
Input-Output signals
for gates