Professional Documents
Culture Documents
Digital systems are built from circuits that process binary digits 0s and 1s and are used in:
o Communication; oTraffic control and Space guidance; o Medical treatment; o Weather monitoring; o Digital telephone, Television and Camera o Digital Computer and Internet
One characteristic of Digital Systems is their ability to manipulate discrete element of information like : o 10 decimal digits from 0..9 ; o 26 letters of the alphabet from a.. Z
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 1 page: 2
Discrete elements of information are represented with a group of bits called binary Codes.
For example: Decimal digits 0 to 9 are represented in digital system with code of 4 bits.
EE208: Logic Design 1431-1432 Chapter 1 page: 3
Chapter 1 page: 4
To understand the operation of each digital module it is necessary to have a basic knowledge of digital circuits and their logic function The digital computer manipulates : oNumerical values; oLogic Values; oSet of symbol oMisc objects: voice, images, etc
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 1 page: 5
To understand the operation of each digital module it is necessary to have a basic knowledge of digital circuits and their logic function The digital computer manipulates : oNumerical values; oLogic Values; oSet of symbol oMisc objects: voice, images, etc
Dr. Ridha Jemal EE208: Logic Design 1431-1432 Chapter 1 page: 6
Binary Numbers
A decimal number 7251 represents a quantity equal to : 7 thousands + 2 hundreds + 5 tens + 1 unit To be more exact this number should be written as: 7 x 103+ 2 x 102 + 5 x 101 + 1 x 100 In general a number with decimal point is represented by a series of coefficients as follows : a4 a3 a2 a1 a0 a-1 a-2 a-3 The aj coefficients are any of the 10 digits (0, 1, 2, , 9), and the subscript value j gives the place value and, hence, the power of 10 by which the coefficient must be multiplied. This can be expressed as: a4x104 + a3x103+ a2x102 + a1x101+ a0x100 + a-1x10-1 + a-2x10-2+ a-3x10-3
The General form can be expressed as: anx10n + an-1x10n-1 + + a0x100 + a-1x10-1 + + a-mx10-m n = (digit number before the point )-1 m = digit number after the point
Dr. Ridha Jemal EE351: Control Systems 1431-1432 Chapter 1 page: 7
Binary Numbers
The decimal number system is said to be of base or radix 10 because it uses 10 digits and the coefficient are multiplied by power of 10. The binary system is a different number system. The coefficients of the binary number have only two possible values : 0 or 1. Each coefficient aj is multiplied by 2j For example, the decimal equivalent of the binary number 11010.11 is .. as shown from the multiplication of the coefficient by powers of 2 1x24 + 1x23 + 0x22 + 1x21 + 0x20 + 1x2-1 + 1x2-2 = 26.75 For example, a number expressed in a base-r system has coefficients multiplied by powers of r an x rn + an-1 x rn-1 + + a2 x r2 + a1 x r1 + a0 x r0 + a-1 x r-1 + + a-m x r-m
Chapter 1 page: 8
Binary Numbers
There are may bases:
Examples:
o o o o (4021.2)5 (127.4)8 (B65F)16 (110101)2 = = = = 511.4 10 87.5 10 46687 10 53 10
Chapter 1 page: 9
We now present a general procedure for the reverse operation of converting a decimal number to a number of base r
Consider what happens if we divide the formula by r we will get a quotient Q and a reminder di. The quotient has the same form as the original formula .Therefore, successive divisions by r will yield successive digits of D from right to left, until all the digits of D have been derived. The sequence of reminders are listed in the reverse order of the division process
Chapter 1 page: 11
Binary (Base 2) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Octal (Base 8) 00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17
Complements
Complements are used in digital computer for simplifying the subtraction operation and for logical manipulation. There are two types of complements for each base-r system: The radix complement (rs complement) The diminished radix complement ((r-1)s complement)
Complements
The 1s complement is obtained by changing 1s to 0s and 0s to 1s The 1s complement of 1011000 is 0100111
The 10s complement of 012398 is 987602 The 10s complement of 246700 is 753300
o For r=2,
Given a binary umber 10100101 The 1s complement of 10100101 is 01011010 The 2s complement of 10100101 is 01011010+1 = 01011011
Dr. Ridha Jemal EE351: Control Systems 1431-1432 Chapter 1 page: 16
0 1010010 as unsigned number is equal to : 1 1010010 as unsigned number is equal to : 1 1010010 as signed number is equal to :
Dr. Ridha Jemal EE351: Control Systems 1431-1432 Chapter 1 page: 17
Signed Magnitude
Use MSB as a flag: 0=+ve, 1=-ve ("sign bit") All other bits hold the magnitude eg. using 4 bits 0110 = 6 1010 = -2
Ones Complement
Given a number N in base 2 having n digits, the 1s complement of N is defined as (2n 1) N The 1s complement is obtained by changing 1s to 0s and 0s to 1s The 1s complement of 1011011 is 0100100
EE351: Control Systems 1431-1432 Chapter 1 page: 18
1.
Example 1:
+8 +17 +25 001000 010001 011001 + 24 + 32 +56 0011000 0100000 --------------------------------------0111000
-------------------------------
If the signs are different, we subtract the smaller magnitude from the larger and we give the result the sign of the larger magnitude. This process requires a comparison and subtraction. So we will use only the addition in the signed complement system without need to use the comparison and the subtraction. Subtraction = Addition of the 2s complement of the negative number
Dr. Ridha Jemal EE351: Control Systems 1431-1432 Chapter 1 page: 20
+9
If the result is negative, we will take its 2s complement to get the final result
Example 3:
0011000 1011101 2s complement of 0100011 --------------------------------------1110101 Its a negative number, we take its
Chapter 1 page: 21
Chapter 1 page: 22
Binary Codes
Digital Systems represent and manipulate not only binary numbers but also many other discrete elements of information which can be represented by a binary code. An n-bit binary code is a group of n bits that assume up to 2n distinct combinations of 1s and 0s. Examples: o A set of four elements can be coded with two bits: 00, 01, 10 and 11 o A set of 16 elements requires a 4-bit code Decimal Symbol BCD Digit BCD Code (Binary Coded Decimal) 0 0000 1 0001 A number with k decimal digits will 2 0010 require 4k bits in BCD 3 0011 4 0100 5 0101 (396)10 = (0011 1001 0110)BCD 6 0110 7 0111 8 1000 9 1001
Dr. Ridha Jemal EE351: Control Systems 1431-1432 Chapter 1 page: 24
Binary Codes
BCD Addition
Consider the addition of two decimal digits in BCD, together with a possible carry from previous less significant pair of bits: If the result is greater or equal 1010, the result is an invalid BCD digit; The addition of 6 = (0110)2 to the binary sum converts it to the correct digit and also produces a carry as required.
Examples: 4 0100 +5 +0101 ----------------+9 1001
Binary Codes
BCD Addition (contd.) The addition of two n-digit unsigned BCD numbers follows the same procedure. Consider the addition of 184 +576
184 +576 0001 1000 0100 +0101 0111 0110 -------------------------------0110 1111 1010 0110 0110 1 1 -------------------------------0111 0110 0000 7 6 0
+ +
Chapter 1 page: 26
Decimal Equivalent 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ASCII Code 100 0001 110 0001 100 0010 110 0010 . . . 100 0110 110 0110 100 0111 110 0111 . . . 011 0001= 31Hex 011 0011= 33Hex
Characters A a B b . . . F f G g . . . 1 3
Chapter 1 page: 27
Binary Logic
AND gate
Binary Logic consists on Binary variables and Logical operations o Variables : A, B, C, . Z, a, b, c, 1, 2, 3 expressed in the binary system o Logical Operations : 3 fundamental operations A ND, OR, INV
AND : Result TRUE if and only if both input operands are true C= AB Its graphic Symbol is:
A B
Dr. Ridha Jemal
A 0
B 0
C 0
0
1 C 1
1
0 1
0
0 1
Chapter 1 page: 28
Binary Logic
OR and NOT gates
OR : Result TRUE if operands are true C= A+B C Its graphic Symbol is: A B
A 0
B 0
C 0
0
1 1
1
0 1
1
1 1
NOT : Result TRUE if single input value is FALSE C= A C Its graphic Symbol is: A
Dr. Ridha Jemal EE351: Control Systems 1431-1432
A
0 1
C
1 0
Chapter 1 page: 29