Chapter 1: Digital Systems and Binary Numbers
Chapter 1: Digital Systems and Binary Numbers
Chapter 1: Digital Systems and Binary Numbers
… a5a4a3a2a1.a1a2a3… aj
Decimal point Power
105 a5 104 a4 103 a3 102 a2 101 a1 100 a0 101 a1 10 2 a2 10 3 a3
Example:
Special Powers of 2
•Multiplication
Multiplicand 1011
Multiplier 101
Partial Products 1011
0000 -
1011 - -
Product 110111
Number-Base Conversions
Example1.3
Convert (0.6875)10 to binary.
The process is continued until the fraction becomes 0 or until the number of digits has
sufficient accuracy.
Number-Base Conversions
Example1.3
(10 110 001 101 011 . 111 100 000 110) 2 = (26153.7406)8
2 6 1 5 3 7 4 0 6
Conversion from binary to hexadecimal is similar, except that the binary number is
divided into groups of four digits:
Example:
For binary numbers, r = 2 and r –1 = 1, so the 1's complement of N is (2n 1) –N.
Example:
Complements of Numbers
■ Radix Complement
The r's complement of an n-digit number N in base r is defined as rn –N for N ≠ 0
and as 0 for N = 0. Comparing with the (r 1) 's complement, we note that the r's
complement is obtained by adding 1 to the (r 1) 's complement, since rn –N = [(rn
1) –N] + 1.
Example: Base-10
Example 1.6
Using 10's complement, subtract 3250 –72532
Table 3 lists all possible four-bit signed binary numbers in the three representations.
Signed Binary Numbers
Signed Binary Numbers
■ Arithmetic Addition
The addition of two numbers in the signed-magnitude system follows the rules of
ordinary arithmetic. If the signs are the same, we add the two magnitudes and give
the sum the common sign. If the signs are different, we subtract the smaller
magnitude from the larger and give the difference the sign if the larger magnitude.
The addition of two signed binary numbers with negative numbers represented in
signed-2's-complement form is obtained from the addition of the two numbers,
including their sign bits.
A carry out of the sign-bit position is discarded.
Example:
Binary Codes
■ BCD Code A number with k decimal digits will
require 4k bits in BCD. Decimal 396
is represented in BCD with 12bits as
0011 1001 0110, with each group
of 4 bits representing one decimal
digit. A decimal number in BCD is
the same as its equivalent binary
number only when the number is
between 0 and 9. A BCD number
greater than 10 looks different from
its equivalent binary number, even
though both contain 1's and 0's.
Moreover, the binary combinations
1010 through 1111 are not used
and have no meaning in BCD.
Signed Binary Numbers
■ Arithmetic 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.
( A)
( B ) ( A) ( B )
( A)
( B ) ( A) ( B )
Example:
(11111010 + 00001101)
00000111 (+ 7)
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
Binary Codes
■ Other Decimal Codes
Binary Codes
■ Gray Code
Binary Codes
■ ASCII Character Code
Binary Codes
■ ASCII Character Code
Binary Codes
■ ASCII Character Code
ASCII Character Codes
•American Standard Code for Information
Interchange (Refer to Table 1.7)
•A popular code used to represent information sent
as character-based data.
•It uses 7-bits to represent:
– 94 Graphic printing characters.
– 34 Non-printing characters
•Some non-printing characters are used for text
format (e.g. BS = Backspace, 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 Properties
• A binary cell
– two stable state
– store one bit of information
– examples: flip-flop circuits, ferrite cores, capacitor
• A register
– a group of binary cells
– AX in x86 CPU
■ Register Transfer
a transfer of the information stored in one register to another
one of the major operations in digital system
an example
Transfer of information
•The other major component of a digital system
–circuit elements to manipulate individual bits of information
Binary Logic
■ Definition of Binary Logic
Binary logic consists of binary variables and a set of logical operations. The variables
are designated by letters of the alphabet, such as A, B, C, x, y, z, etc, with each
variable having two and only two distinct possible values: 1 and 0, There are three
basic logical operations: AND, OR, and NOT.
Binary Logic
■ The truth tables for AND, OR, and NOT are given in Table 1.8.
Binary Logic
■ Logic gates
Example of binary signals
Binary Logic
■ Logic gates
Graphic Symbols and Input-Output Signals for Logic gates:
Fig. 1.5
Input-Output signals
for gates
Binary Logic
■ Logic gates
Graphic Symbols and Input-Output Signals for Logic gates: