What Is Digital System?: Hapter Igital Ystems
What Is Digital System?: Hapter Igital Ystems
What Is Digital System?: Hapter Igital Ystems
1 DIGITAL SYSTEMS
- Digital System: is a system in which signals have finite number of discrete values
(electric impulses, decimal digits, arithmetic operations, etc.)
- Analog System: is a system in which signals have infinite number of values (electric
voltage that vary with time).
- Synchronous: Systems where signals may change only at discrete instants.
- Asynchronous: Systems where signals may change at any instant.
-
- Numerical digital systems can be made more accurate by increasing the number of
digits used in the representation.
- Complex digital systems are built as integrated circuits composed of a large number
of very simple devices.
- It is possible to select among different implementations of systems that trade off
speed and amount of hardware.
Binary 2 0,1
Octal 8 0,1,2,3,4,5,6,7
Decimal 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F
- The conversion from decimal integers to any base-r system is similar to the
example, except that division is done by r instead of 2.
153
19 1
2 3
0 2 = (231) 8
- The conversion from decimal fraction to any base-r system is similar to the example.
Multiplication is by r instead of 2, and the coefficients found from the integers may
range in value from 0 to r-1 instead of 0 and 1.
0.513 x 8 = 4.104
0.104 x 8 = 0.832
0.832 x 8 = 6.656
0.656 x 8 = 5.248
0.248 x 8 = 1.984
0.984 x 8 = 7.872
(0.513) 10 = (0.406517…) 8
- The conversion of decimal numbers with both integers and fraction parts is done by
converting the integer and fraction separately and then combining the two answers.
Octal and Hexadecimal Numbers
- The conversion from and to binary, octal and hexadecimal plays an important part in
digital computers. Since 23 = 8 and 24 = 16, each octal digit corresponds to three
binary digits and each hexadecimal digit corresponds to four binary digits.
(10 110 001 101 011. 111 100 000 110) 2 = (26153.7406) 8
(37B) 16
3 x 162 + 7 x 161 + 11 x 160
= 3 x 256 + 7 x 16 + 11 x 1
= 768 + 112 +11
= (891) 10
Complements
- Are used to simplify the subtraction operation and for logical manipulation.
- The 1’s complement of a binary number is formed by changing 1’s to 0’s and 0’s to
1’s.
Radix Complement
- The 2’s complement can be formed by leaving the least significant 0’s and the first 1
unchanged, and the replacing 1’s with 0’s and 0’s with 1’s in the other four most-
significant digits.
- The 2’s complement of the following number is obtained by leaving the least
significant 1 unchanged, and complementing all other digits.
Summary
- The radix complement and diminished radix complement are defined as:
(N) r = an n-digit number N in base r
[N] r = the r’s complement of (N)r
[N] r-1 = the (r-1)’s complement of (N)r
[N] r = rn - (N)r (Eq.1)
[N] r-1 = [N]r - 1 (Eq.2)
From Eq.1 and Eq.2, we can also derive the following equations:
The 9's complement of a decimal number is obtained by subtracting each digit from 9.
The 7's complement of an octal number is obtained by subtracting each digit from 7.
The 1's complement of a binary integer is obtained by subtracting each digit from 1.
Examples:
M = 72532
10’s complement of N = + 96750 (99999 – 03250) + 1
Sum = 169282
Discard end carry 105 =- 100000
Answer = 69282
Example (2):
Using 10’s complement, subtract 3250 – 72532
M – N
M = 03250
10’s complement of N = + 27468 (99999 – 72532) + 1
Sum = 30718
No end carry.
Answer - (10’s complement of 30718) = - 69282
Example (3):
Using 2’s complement, subtract 1010100 – 1000011
X – Y
X = 1010100
2’s complement of Y = + 0111101
Sum = 10010001
Discard end carry 27 = - 10000000
Answer: X - Y = 0010001
Example (4):
Using 2’s complement, subtract 1000011 – 1010100
Y – X
Y = 1000011
2’s complement of X = + 0101100
Sum = 1101111
No end carry.
Answer: Y – X - (2’s complement of 1101111) = -0010001
- It is customary to represent the sign with a bit placed in the leftmost position of the
number and to make it 0 for positive and 1 for negative.
- Consider the number 9 represented in binary with 8 bits. +9 is represented with sign
bit 0 in the leftmost position followed by the binary equivalent of 9 to give 00001001.
00001001
Signed magnitude 10001001
Signed-1’s complement 11110110
Signed-2’s complement 11110111
Arithmetic Addition
- The addition of 2 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 magnitudes from the larger and
give the result the sign of the larger magnitude.
+6 00000110 -6 11111010
+13 00001101 +13 00001101
00010011 00000111
+6 00000110 -6 11111010
-13 11110011 -13 11110011
11111001 11101101
- Negative numbers must be in 2’s complement and that the sum obtained after the
addition if negative is in 2’s-complement form.
Arithmetic Subtraction
- Take the 2’s complement of the subtrahend (including the sign bit) and add it to the
minuend (including the sign bit). A carry out of the sign-bit position is discarded.
(± A) – (+B) = (± A) + (-B)
(± A) – (-B) = (± A) + (+B)
Binary Codes
- Binary codes play an important role in digital computers. A bit is a binary digit. It is
equal to 0 or 1.
- Although the minimum number of bits required to code 2n quantities is n, there is no
maximum number of bits that may be used for a binary code.
Decimal Codes
- BCD (binary-code decimal) is a straight assignment of the binary equivalent. Check
Table 1-2 page 18.
Error Detection Code
- Binary information can be transmitted from one location to another. External noise
may change some of the bits from 0 to 1 and vice versa. To achieve error-detection
we use a parity bit.
- A parity bit is an extra bit included with a message to the total number of 1’s
transmitted either odd or even. See Table 1-3 Page 20.
- Two methods are implemented:
o Even Parity: the P bit is chosen so that the total number of 1’s in the five bits is
even.
o Odd Parity: the P bit is chosen so that the total number of 1’s in the five bits is
odd.
Gray Code
- Gray code is used to represent the digital data when it is converted from analog
data. See Table 1 – 4 Page 21.
- The advantage of the Gray code over binary numbers is that only one bit in the code
group changes when going from one number to the next.
- In Gray to go from 7 to 8: 0100 1100
In Binary to from: 7 to 8: 0111 1000
Binary Logic
- Deals with variables that take on two discrete values and with operations that
assume logical meaning.
- The 2 values may be called by different names (e.g. true/false, yes/no, 0/1)
- It is suited for the analysis and design of digital systems.
Definition of Binary Logic
- Consists of binary variables and logical operations.
o Variables: A, B, C, x, y, z, etc., with each variables having two values 1 and 0
o Logical Operations:
AND: is represented by a dot or an absence of an operator.
EX: x . y = z or xy = z or is read as “x AND y is equal to z.”
It means z = 1 iff x = 1 and y = 1; otherwise, z = 0.
OR: is represented by + sign.
EX: x + y = z or is read as “x OR y is equal to z.”
It means z = 1 if x = 1 or if y = 1 or if x = 1 and y =1. if both x = 0
and y= 0, then z = 0.
NOT: is represented by ‘ or -.
EX: x’ = z (or = z) is read, “not x is equal to z,” meaning that z is
what x is not. In other words, if x = 1, then z = 0; but if x = 0, then z
= 1.
For each combination of values x and y, there is a value z specified by the
definition of the logical operation. The definition is listed in compact form
using truth tables.
AND OR NOT
x y x.y x y x+y x x’
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
Logic Gates
- Electronic digital circuits are called logic circuits because, with the proper input, they
establish logical manipulation paths. See Fig. 1 – 6 Page 31.
z= x.y z= x+y
x x
x x’
y y