You are on page 1of 33

DIGITAL CIRCUIT

DESIGN
EEE122 A
Ref. Morris MANO & Michael D. CILETTI
DIGITAL DESIGN 4th edition

Fatih University- Faculty of Engineering- Electric and Electronic Dept.

WHAT IS DIGITAL CIRCUIT







Engineers generally classify electronic


circuits as being either analog or digital.
Analog circuit works with sinusoidal
signals
Digital circuit works with discrete signals
Today Most electronic devices are
composed of digital circuits

Advantages of Digital over Analog Circuit




Easier to design using integrated


circuit
Have very effective information
storage
Can be programmed to suite the
required situation
More accurate and of less affected by
electromagnetic noises

APPLICATION OF DIGITAL CIRCUIT










Digital Calculators
Computer systems
Robot system
Measurement devices
Telecommunication systems
Control circuits
Controllers

Number Systems

Decimal Numbers (Base 10)




A decimal number with point is represented by a series of


coefficients as:
... a4 a3 a2 a1 a0.a-1 a-2 a-3...
The coeffients are any of the digits (0,1,2,3... 9)
The value of a digit is determined by its position in the
number. Thus the above number can be represented as:
a4104+a3103+a2102+a1101+a0100+a-110-1 +a-210-2+a-310-3
Thus the number 4259.143 can be expressed as:
4x103+2x102+5x101+9x100+1x10-1 +4x10-2+3x10-3

Where 10 is the base or radix of the decimal nmbers

Binary Numbers
Decimal

It is composed as
combination of two
digits (0 and 1). The
first few counting in
binary is shown in
the table besides
decimal numbers for
comparison.

Binary

10

11

100

101

110

111

1000

1001

10

1010

11

1011

The weighting structure of binary numbers


... a4 a3 a2 a1 a0.a-1 a-2 a-3...

Positive power of two


(whole number)

Negative power of two


(fractional number)

25

24

23

22

21

20

2-1

32

16

1/2 1/4 1/8 1/1 1/3 1/6


6
2
4
0.5

2-2

0.25

2-3

0.125

2-4

0.0625

2-5

0.03125

2-6

0.01562
5

Binary-to-Decimal Conversion


Add the weights of all 1s in a binary


number to get the decimal value.
ex: convert 10101002 to decimal
Weight

26

25

24

23

22

21

20

bin

10101002
= 26 + 0 + 24 +0+ 22 +0+0
= 64 + 16 + 4
= 84

Binary-to-Decimal Conversion


Fractional binary example


ex: convert 0.1101 to decimal
Weight

2-1

2-2

2-3

24

bin

0.1101

= 2-1 + 2-2 + 2-4


= 0.5 + 0.25 + 0.0625
= 0.8125

Decimal-to-Binary Conversion
(two methods)


1: Sum-of-weights method
To get the binary number for a given
decimal number, find the binary weights
that add up to the decimal number.
ex: convert 1210 , 2510 , 5810 , 8210 to binary
12
25
58
82

=
=
=
=

8+4 = 23+22 = 1100


16+8+1 = 24+23+20 = 11001
32+16+8+2 = 25+24+23+21 = 111010
64+16+2 = 26+24+21 = 1010010

Decimal-to-Binary Conversion


2: Repeated
division-by-2
method
To get the binary
number for a given
decimal number,
divide the decimal
number by 2 until
the quotient is 0.
Remainders form
the binary number.
4110 = 1010012

remainder
41/2 = 20

20/2 = 10

10/2 = 5

5/2

= 2

2/2

= 1

1/2

= 0

LSB

MSB

Decimal-to-Binary Conversion


Converting decimal fractions to binary


Sum-of-weights


This method can be applied to fractional


decimal numbers, as shown in the following
example:
0.625 = 0.5+0.125 = 2-1+2-3 = 0.101

Repeated multiplication by 2


Decimal fraction can be converted to binary


by repeated multiplication by 2

Repeated Multiplication by 2


ex: convert the decimal fraction 0.3125 to binary


carry
MSB

0.3125 x 2 =

0.625

0.625 x 2 =

1.25

0.25 x 2 =

0.50

0
LSB

0.50 x 2 =
Continue to the desired number of
decimal places or stop when the
fractional part is all zero

1.00

0.312510 = 0.01012

Hexadecimal and Octal


Numbers

Hexadecimal (hex) Numbers


It composed of 16 characters. Digits 0-9
and letters A, B, C, D, E, & F representing
the numbers from 10 -to- 15.
 It used as a compact method to express or
display binary numbers.
 Hexadecimal is commonly used in
microprocessor impeded systems.

Hexadecimal Numbers
Decimal

Binary

Hexadecimal

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

10

1010

11

1011

12

1100

13

1101

14

1110

15

1111

Hexadecimal Numbers


The notation h is commonly used in


computer impeded system to stand
for hexadecimal numbers.
example
16h =(16)16 = 000101102
0Dh =(AD)16 = 101011012

Hexadecimal Numbers


Bin-to-Hex Conversion
Simply break the binary number into 4-bit groups, starting
at the right-most bit and replace each 4-bit group with the
equivalent hex symbol.
(a) 1100101001010111
1100101001010111

= CA5716

(b) 111111000101101001
00111111000101101001

= 3F16916

Hexadecimal Numbers


Hex-to-Bin Conversion
Reverse the process (of bin-to-hex) and
replace each hex symbol with its
equivalent four bits.
ex: Determine the binary numbers for the following hex
numbers:
(a) 10A4h
1
0
A

0001000010100100

(b) CF8Eh
C
F
8

1100111110001110

(c) 9742h
9
7
4

1001011101000010

Hexadecimal Numbers


Hex-to-Dec Conversion
2 methods:
Hex-to-Bin first and then Bin-to-Dec.
 Multiply the decimal values of each hex
digits by its weight and then take the sum
of these products.


Hexadecimal Numbers


Hex-to-Dec Conversion
Hex-to-Bin first and then Bin-to-Dec
ex: Convert the following hex numbers to decimal:
(a) 1Ch
1Ch = 00011100 = 16+8+4 = 2810
(b) A85h
A85h = 101010000101 = 2048+512+128+4+1 = 269310

Hexadecimal Numbers


Hex-to-Dec Conversion
Multiply the decimal values of each hex digits by its
weight and then take the sum of these products.
ex: Convert the following hex numbers to decimal:
(a) E5h
E5h = (Ex16)+(5x1) = (14x16)+5 = 224+5 = 22910
(b) B2F8h
B2F8h = (Bx4096)+(2x256)+(Fx16)+(8x1)
= (11x4096)+(2x256)+(15x16)+(8x1)
= 45,056+512+240+8 = 45,81610

Hexadecimal Numbers


Dec-to-Hex conversion
Repeated division of a dec number by
16

ex: Convert the dec number 650 to hex


650/16 = 40.625
40/16 = 2.5
2/16 = 0.125
Stop when whole number
quotient is ZERO.

0.625x16 = 10 = A
0.5x16

=8

0.125x16 = 2

=8
=2

LSD
Hence 65010 = 28A h
MSD

Octal Numbers


Like the hex, the oct


provides a convenient
way to express binary
numbers and codes,
but not commonly
used.
It uses 8 digits: 0-7 as
in the table:

Octal Numbers
The conversion to/from other bases follow the same rules
as the hexadecimal ones, examples:
Bin-to-Oct Conversion
(a) 101110101
(b) 1011011001
Grouped into 3 digits and write the equivalent octal number
(a) 101110101
(b) 1011011001
(565)8
(1331)8


Oct-to-Bin Conversion
(a) 138
(b) 258
(c) 75268
(a) 011011 (b) 010101 (c) 111101010110

Oct-to-Dec Conversion
(a) 23748 = 2x83 +3x82 +7x81 + 4x80
=1024+192+56+4=(1276)10

Dec-to-Oct Conversion
(a) 35910 =(447)8

Remainder
359/8

44

7 LSB

44/8

4/8

MSB

Binary Arithmetical Operation


addition
subtraction
multiplication
division

Binary Addition


The four basic rules for adding binary


digits are as follows:
0+0=0
0+1=1
1+0=1
1+1=10

11
+11
110

3
+3
6

 sum of 0 with a carry of 0


 sum of 1 with a carry of 0
 sum of 1 with a carry of 0
 sum of 0 with a carry of 1

111
+ 11
1010

7
+3
10

110
+100
1010

6
+4
10

Binary Subtraction


The four basic rules for subtracting


binary digits are as follows:
0-0
1-1
1-0
10-1

11
-01
10

=
=
=
=

3
-1
2

0
0
1
1 ; 0-1 with a borrow of 1

11
-10
01

3
-2
1

101
-011
010

5
-3
2

Binary Multiplication


The four basic rules for multiplying digits are as


follows:
0x0 = 0
0x1 = 0
1x0 = 0 1x1 = 1
Multiplication is performed with binary numbers
in the same manner as with decimal numbers.
It involves forming partial products, shifting
each successive partial product left one place,
and then adding all the partial products.

11
x11
11
+11
1001

101
x111
101
101
+101
100011

Binary Division


Division in binary follows the same


procedure as division in decimal.
10
11 110
11
000

11
10 110
10
10
10
00

1s and 2s Complements


Negative numbers are normally presented in 1s or 2s


complement.
The method of 2s complement arithmetic is commonly
used in computer systems to handle negative numbers
more than 1s complement.

Diminished Radix complement

1s

Given a number N in base r having n digits , the (r-1)s


complement of N is defined as (rn-1)-N.

Radix Complement:

2s

The rs complement of an n-digit number N in base r is defined as


(rn-N) for N0 and as 0 for N=0

To find the 1s complement for a given binary number:




Complement every bit in the number the


result is 1s complement
ex: find 1s complement of 111001012
Binary

1 1 1 0 0 1 0 1

1s complement

0 0 0 1 1 0 1 0

To find the 2s complement for a given binary number:


Add 1 to the 1s complement to get the 2s complement.
ex: 10110010  01001101  01001110

You might also like