Digital Logic Design: Dr. Sachchida Nand Chaurasia

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

DIGITAL LOGIC DESIGN

by

Dr. Sachchida Nand Chaurasia

Department of Computer Science


Banaras Hindu University,
Varanasi

Binary Systems 1
Digital Systems
 They manipulate discrete information
(A finite number of elements)
 Example discrete sets
 10 decimal digits, the 26 letters of alphabet
 Information is represented in binary
form
 Examples
 Digital telephones, digital television, and digital
cameras
 The most commonly used one is DIGITAL
COMPUTERS

Binary Systems 2
Digital Computers
CENTRAL PROCESSING UNIT
Registers
Arithmetic R1
Control Unit Logic R2
Unit (ALU) Rn

Bus

Main Disk Keyboard Printer


Memory

Binary Systems I/O Devices 3


Binary Signals
 It means two-states
 1 and 0
 true and false
 on and off
 A single “on/off”, “true/false”, “1/0” is
called a bit
 Example: Toggle switch

Binary Systems 4
Byte
 Computer memory is organized into
groups of eight bits
 Each eight bit group is called a byte

Binary Systems 5
Why Computers Use Binary
 They can be represented with a
transistor that is relatively easy to
fabricate (in silicon)
 Millions of them can be put in a tiny chip
 Unambiguous signal (Either 1 or 0)
 This provides noise immunity

Binary Systems 6
Analog Signal

Binary Systems 7
Binary Signal

 A voltage below the threshold


 off
 A voltage above the threshold
 on

Binary Systems 8
Binary Signal

Binary Systems 9
Noise on Transmission
 When the signal is transferred it will
pick up noise from the environment

Binary Systems 10
Recovery
 Even when the noise is present the
binary values are transmitted without
error

Binary Systems 11
Binary Numbers
 A number in a base-r system
x = xn-1xn-2 ... x1x0 . x-1 x-2 ... X-(m-1) x-m

n−1 n−2 0 −1 −2 −m
Value( x )=x n−1⋅r +x n−2⋅r +. . .+x 0⋅r +x−1⋅r +x−2⋅r +. ..+ x−m⋅r

2 1 0 −1 −2
(234 . 26 )6 =2⋅6 +3⋅6 +4⋅6 +2⋅6 +6⋅6 =(94 . 5 )10
1 0 −1
(45 . 4 )8 =4⋅8 +5⋅8 +4⋅8 =(39 .5 )10

Binary Systems 12
Radix Number System
 Base – 2 (binary numbers)
 01
 Base – 8 (octal numbers)
 01234567
 Base – 16 (hexadecimal numbers)
 0123456789ABCDEF

Binary Systems 13
Radix Operations
 The same as for decimal numbers

11001011 11001011 101

+10011101 - 10011101 * 110

101101000 00101110 000


1010
+10100
11110

Binary Systems 14
Conversion From one radix
to another
 From decimal to binary

Binary Systems 15
Conversion From one radix
to another
 From decimal to base-r
 Separate the number into an integer part and a
fraction part
 For the integer part
 Divide the number and all successive quotients
by r
 Accumulate the remainders

165
0.6875 x 2 = 1 + 0.3750
23 4
0.3750 x 2 = 0 + 0.7500
3 2
0.7500 x 2 = 1 + 0.5000
0 3
0.5000 x 2 = 1 + 0.0000

(165)10 =(324 )7 (0 .6875)10 =( 0 .1011 )2


Binary Systems 16
Different Bases

Binary Systems 17
Conversion From one radix
to another
 From binary to octal
 Divide into groups of 3 bits
 Example
 11001101001000.1011011 = 31510.554
 From octal to binary
 Replace each octal digit with three bits
 Example
 75643.5704 = 111101110100011.101111000100

Binary Systems 18
Conversion From one radix
to another
 From binary to hexadecimal
 Divide into groups of 4 bits
 Example
 11001101001000.1011011 = 3348.B6
 From hexadecimal to binary
 Replace each digit with four bits bits
 Example
 7BA3.BC4 = 111101110100011.101111000100

Binary Systems 19
Complements
 They are used to simplify the subtraction
operation
 Two types (for each base-r system)
 Diminishing radix complement (r-1 complement)
 Radix complement (r complement)

For n-digit number N

n r-1 complement
(r −1 )−N
n
r −N r complement

Binary Systems 20
9’s and 10’s Complements
 9’s complement of 674653
 999999-674653 = 325346
 9’s complement of 023421
 999999-023421 = 976578
 10’s complement of 674653
 325346+1 = 325347
 10’s complement of 023421
 976578+1=976579

Binary Systems 21
1’s and 2’s Complements
 1’s complement of 10111001
 11111111 – 10111001 = 01000110
 Simply replace 1’s and 0’s
 1’s complement of 10100010
 01011101
 2’s complement of 10111001
 01000110 + 1 = 01000111
 Add 1 to 1’s complement
 2’s complement of 10100010
 01011101 + 1 = 01011110

Binary Systems 22
Subtraction with
Complements of Unsigned
 M–N
 Add M to r’s complement of N
 Sum = M+(rn – N) = M – N+ rn
 If M > N, Sum will have an end carry rn , discard it
 If M<N, Sum will not have an end carry and
 Sum = rn – (N – M) (r’s complement of N – M)
 So M – N = – (r’s complement of Sum)

Binary Systems 23
Subtraction with
Complements of Unsigned
 65438 - 5623
65438
10’s complement of 05623 +94377
159815
Discard end carry 105 -100000
Answer 59815

Binary Systems 24
Subtraction with
Complements of Unsigned
 5623 - 65438
05623
10’s complement of 65438 +34562
40185
There is no end carry =>
-(10’s complement of 40185)
-59815

Binary Systems 25
Subtraction with
Complements of Unsigned
 10110010 - 10011111
10110010
2’s complement of 10011111 +01100001
100010011
Discard end carry 2^8 -100000000
Answer 000010011

Binary Systems 26
Subtraction with
Complements of Unsigned
 10011111 -10110010
10011111
2’s complement of 10110010 +01001110
11101101
There is no end carry =>
-(2’s complement of 11101101)
Answer = -00010011

Binary Systems 27
Signed Binary Numbers
 Unsigned representation can be used
for positive integers
 How about negative integers?
 Everything must be represented in binary
numbers
 Computers cannot use – or + signs

Binary Systems 28
Negative Binary Numbers
 Three different systems have been
used
 Signed magnitude
 One’s complement
 Two’s complement

NOTE: For negative numbers the sign bit is always


1, and for positive numbers it is 0 in these three
systems

Binary Systems 29
Signed Magnitude
 The leftmost bit is the sign bit (0 is + and 1
is - ) and the remaining bits hold the
absolute magnitude of the number
 Examples
 -47 = 1 0 1 0 1 1 1 1
 47 = 0 0 1 0 1 1 1 1

For 8 bits, we can represent the signed integers


–128 to +127
How about for N bits?

Binary Systems 30
One’s complement
 Replace each 1 by 0 and each 0 by 1
 Example (-6)
 First represent 6 in binary format (00000110)
 Then replace (11111001)

Binary Systems 31
Two’s complement
 Find one’s complement
 Add 1
 Example (-6)
 First represent 6 in binary format (00000110)
 One’s complement (11111001)
 Two’s complement (11111010)

Binary Systems 32
Arithmetic Addition
 Usually represented by 2’s complement
Discard

+5 00000101 -5 11111011
+11 00001011 +11 00001011
+16 00010000 +6 100000110

+5 00000101 -5 11111011
-11 11110101 -11 11110101
-6 11111010 -16 111110000

Binary Systems
Discard 33
Registers
 They can hold a groups of binary data
 Data can be transferred from one
register to another

Binary Systems 34
Processor-Memory Registers

Binary Systems 35
Operations

Binary Systems 36
Logic Gates - 1

Binary Systems 37
Logic Gates - 2

Binary Systems 38
Ranges

The gate input The gate output

Binary Systems 39

You might also like