0% found this document useful (0 votes)
48 views

Chapter 1: Digital Systems and Binary Numbers

Digital systems represent information using binary numbers consisting of only 1s and 0s. Common digital systems include computers, smart phones, and digital cameras. Numbers in digital systems use a base-2 numbering system where each place value is a power of 2. Other number bases like octal and hexadecimal are also used. Signed binary numbers use the most significant bit to indicate a number's sign. Binary codes like ASCII assign numeric values to letters, punctuation, and other characters for digital representation and transmission of text.

Uploaded by

李亞竹
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Chapter 1: Digital Systems and Binary Numbers

Digital systems represent information using binary numbers consisting of only 1s and 0s. Common digital systems include computers, smart phones, and digital cameras. Numbers in digital systems use a base-2 numbering system where each place value is a power of 2. Other number bases like octal and hexadecimal are also used. Signed binary numbers use the most significant bit to indicate a number's sign. Binary codes like ASCII assign numeric values to letters, punctuation, and other characters for digital representation and transmission of text.

Uploaded by

李亞竹
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Chapter 1: Digital Systems and Binary Numbers

• Digital systems:
e.g.

– digital camera

– calculators, smart phone

– digital TV, computer


 原編者 : 嚴茂旭 副教授
 修改 : 盧晃瑩

National Taiwan Ocean University


Department of Computer Science & Information Engineering
Base- r Numbers
• Decimal number Base or radix

an-1… a5a4a3a2a1a0.a1a2a3… aj
Decimal point
Power

  105 a5  104 a4  103 a3  102 a2  101 a1  100 a0  10 1 a1  10 2 a 2  10 3 a 3  

Example:

7,329  7  103  3  102  2  101  9  100

• General form of base-r system


an  r n  an 1  r n 1    a2  r 2  a1  r1  a0  a1  r 1  a2  r 2    a m  r  m

Coefficient: aj = 0 to r  1
Note: Special Powers of 2

 210  1K  220  1M  230  1G


Octal and Hexadecimal Numbers
 Numbers with different bases: Table 1.2.
Number-Base Conversions

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

1' s complement : - (2 n 1 -1) ~ (2 n 1 -1)


2 ' s complement : (-2 n 1 ) ~ (2 n 1 -1)

Ex: Consider a 4-bit or 8 bit signed binary nubmer system.


Express its numerical range
Sol:
Signed Binary Subtraction
 In 2’s-complement form:
1. Take the 2’s complement of the subtrahend (including the sign bit) and add it to
the minuend (including sign bit).
2. A carry out of sign-bit position is discarded.
Signed Binary Subtraction
 In 1’s-complement form:
1. Take the 1’s complement of the subtrahend (including the sign bit) and add it to
the minuend (including sign bit).
2. Remove the end carry and add 1 to the sum (end-around carry)
Signed Binary Subtraction

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

• American Standard Code for Information Interchange

• A popular code used to represent information sent as character-based dat


a.

• It uses 7-bits to represent:


– 94 Graphic printing characters.
– 34 Non-printing (control) characters

• 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

ASCII has some interesting properties:


 Digits 0 to 9 span Hexadecimal values 3016 to 3916 .
.
 Upper case A - Z span 4116 to 5A16.
 Lower case a - z span 6116 to 7A16
• Lower to upper case translation (and vice versa)
occurs by flipping bit 6.
Error-Detection Code: Parity bit
■ Error-Detecting Code
§ To detect errors in data communication and processing, an eighth bit is sometimes
added to the ASCII character to indicate its parity.
§ A parity bit is an extra bit included with a message to make the total number of 1's
either even or odd.
Example:
Consider the following two characters and their even and odd parity:
Binary Logic
■ The truth tables for AND, OR, and NOT are given in Table 1.8.
Binary Logic
■ Logic gates
 Graphic Symbols and Input-Output Signals for Logic gates:

Fig. 1.4 Symbols for digital logic circuits

Fig. 1.5
Input-Output signals
for gates

You might also like