33
DIGITAL CIRCUIT DIGITAL CIRCUIT DESIGN DESIGN EEE122 A EEE122 A Ref. Morris MANO & Michael D. CILETTI Ref. Morris MANO & Michael D. CILETTI DIGITAL DESIGN 4 DIGITAL DESIGN 4 th th edition edition Fatih University- Faculty of Engineering- Electric and Electronic Dept.

[Ch1] EEE122A Number System

  • Upload
    anas

  • View
    40

  • Download
    3

Embed Size (px)

DESCRIPTION

Its all about numerecialr signals and signals of the other signals in this world like road signals alien signals pengiun signals etc. so if u want to study these kind of signals study this books of signals. ty so much for downloading my first book its free tho but u can pay if u want gg wp bye

Citation preview

DIGITAL CIRCUIT DIGITAL CIRCUIT DESIGNDESIGN

EEE122 AEEE122 A

Ref. Morris MANO & Michael D. CILETTIRef. Morris MANO & Michael D. CILETTI

DIGITAL DESIGN 4DIGITAL DESIGN 4thth editionedition

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

WHAT IS DIGITAL CIRCUITWHAT IS DIGITAL CIRCUIT

�� Engineers generally classify electronic Engineers generally classify electronic

circuits as being either analog or digital.circuits as being either analog or digital.

�� Analog circuit works with sinusoidal Analog circuit works with sinusoidal

signalssignals

�� Digital circuit works with discrete signalsDigital circuit works with discrete signals

�� Today Most electronic devices are Today Most electronic devices are

composed of digital circuitscomposed of digital circuits

Advantages of Digital over Analog CircuitAdvantages of Digital over Analog Circuit

�� Easier to design using integrated Easier to design using integrated

circuitcircuit

�� Have very effective information Have very effective information

storagestorage

�� Can be programmed to suite the Can be programmed to suite the

required situationrequired situation

�� More accurate and of less affected by More accurate and of less affected by

electromagnetic noiseselectromagnetic noises

APPLICATION OF DIGITAL CIRCUITAPPLICATION OF DIGITAL CIRCUIT

�� Digital CalculatorsDigital Calculators

�� Computer systemsComputer systems

�� Robot systemRobot system

�� Measurement devicesMeasurement devices

�� Telecommunication systemsTelecommunication systems

�� Control circuitsControl circuits

�� ControllersControllers

Number SystemsNumber Systems

Decimal Numbers (Base 10)Decimal Numbers (Base 10)

�� A decimal number with point is represented by a series of A decimal number with point is represented by a series of

coefficientscoefficients as:as:

... a... a44 aa33 aa22 aa11 aa00..aa--11 aa--22 aa--3...3...

•• The coeffients are any of the digits (The coeffients are any of the digits (00,1,2,3...,1,2,3... 99))

•• The value of a digit is determined by its The value of a digit is determined by its positionposition in the in the

number.number. Thus the above number can be represented as:Thus the above number can be represented as:

aa44101044+a+a33101033+a+a22101022+a+a11101011+a+a00101000++aa--111010--11 +a+a--221010--22+a+a--331010--33

Thus the number 4259.143 can be expressed as:

44xx101033++22xx101022++55xx101011++99xx101000+1x+1x1010--11 ++44xx1010--22++33xx1010--33

Where 10 is the Where 10 is the base base or or ““radixradix”” of the decimal of the decimal nmbersnmbers

Binary NumbersBinary Numbers

�� It is composed as It is composed as

combination of two combination of two

digits (0 and 1). The digits (0 and 1). The

first few counting in first few counting in

binary is shown in binary is shown in

the table besides the table besides

decimal numbers for decimal numbers for

comparison.comparison.

101010101010

101110111111

1001100199

1000100088

11111177

11011066

10110155

10010044

111133

101022

1111

0000

BinaryBinaryDecimalDecimal

The weighting structure of binary numbersThe weighting structure of binary numbers

0.015620.01562

550.031250.031250.06250.06250.1250.1250.250.250.50.5

1/61/6

441/31/3

221/11/1

661/81/81/41/41/21/21122448816163232

22--6622--5522--4422--3322--2222--11220022112222223322442255

Negative power of twoNegative power of two

(fractional number)(fractional number)

Positive power of two Positive power of two

(whole number)(whole number)

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

BinaryBinary--toto--Decimal ConversionDecimal Conversion

�� Add the weights of all 1s in a binary Add the weights of all 1s in a binary number to get the decimal value.number to get the decimal value.

ex: convert ex: convert 10101001010100 22 to decimalto decimal

10101001010100 22 = 2= 2 6 6 + 0+ 0 + 2+ 2 4 4 +0+ 2+0+ 2 2 2 +0+0+0+0= 64 + 16 + 4= 64 + 16 + 4= 84= 84

11001111001111binbin

2200221122222233224422552266WeightWeight

BinaryBinary--toto--Decimal ConversionDecimal Conversion

�� Fractional binary exampleFractional binary example

ex: convert ex: convert 0.11010.1101 to decimalto decimal

0.11010.1101 = 2= 2 -- 1 1 + 2+ 2 -- 2 2 + 2+ 2 -- 44

= 0.5 + 0.25 + 0.0625= 0.5 + 0.25 + 0.0625

= 0.8125 = 0.8125

11110011binbin

224422--3322--2222--11WeightWeight

DecimalDecimal--toto--Binary ConversionBinary Conversion(two methods)(two methods)

�� 1: Sum1: Sum--ofof--weights methodweights method•• To get the binary number for a given To get the binary number for a given decimal number, find the binary weights decimal number, find the binary weights that add up to the decimal number.that add up to the decimal number.

ex: convert 12ex: convert 1210 10 , 25, 2510 10 , 58, 5810 10 , 82, 821010 to binaryto binary

12 = 8+4 = 212 = 8+4 = 2 33+2+22 2 = 1100= 1100

25 = 16+8+1 = 225 = 16+8+1 = 2 44+2+233+2+200 = 11001= 11001

58 = 32+16+8+2 = 258 = 32+16+8+2 = 2 55+2+244+2+233+2+211 = 111010= 111010

82 = 64+16+2 = 282 = 64+16+2 = 2 66+2+244+2+211 = 1010010= 1010010

DecimalDecimal--toto--Binary ConversionBinary Conversion

�� 2: Repeated 2: Repeated

divisiondivision--byby--2 2

methodmethod

•• To get the binary To get the binary

number for a given number for a given

decimal number, decimal number,

divide the decimal divide the decimal

number by 2 until number by 2 until

the quotient is 0. the quotient is 0.

Remainders Remainders formform

the binary number.the binary number. 0011==2/22/2

1122==5/25/2

remainderremainder

1100==1/21/2

0055==10/210/2

001010==20/220/2

112020==41/241/2 LSB

MSB4141 1010 = 101001= 101001 22

DecimalDecimal--toto--Binary ConversionBinary Conversion

�� Converting decimal fractions to binaryConverting decimal fractions to binary

•• SumSum--ofof--weightsweights

�� This method can be applied to fractional This method can be applied to fractional

decimal numbers, as shown in the following decimal numbers, as shown in the following

example:example:

0.625 = 0.5+0.125 = 20.625 = 0.5+0.125 = 2 -- 11+2+2 -- 33 = 0.101= 0.101

•• Repeated multiplication by 2Repeated multiplication by 2

�� Decimal fraction can be converted to binary Decimal fraction can be converted to binary

by by repeated multiplication by 2repeated multiplication by 2

Repeated Multiplication by 2 Repeated Multiplication by 2

�� ex: convert the decimal fraction 0.3125 to binaryex: convert the decimal fraction 0.3125 to binary

carrycarry

111.1. 0000==0.0. 5050 x 2x 2

000.0. 5050==0.0. 2525 x 2x 2

111.1. 2525==0.0. 625625 x 2x 2

000.0. 625625==0.3125 x 20.3125 x 2

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

MSB

LSB

0.31250.3125 1010 = 0.0101= 0.0101 22

Hexadecimal and Octal Hexadecimal and Octal NumbersNumbers

HexadecimalHexadecimal (hex)(hex) NumbersNumbers

It composed of 16 characters. Digits It composed of 16 characters. Digits 00--99and letters and letters A, B, C, D, E, & FA, B, C, D, E, & F representing representing the numbers from 10 the numbers from 10 --toto-- 15.15.

�� It used as a compact method to express or It used as a compact method to express or display binary numbers.display binary numbers.

�� Hexadecimal is commonly used in Hexadecimal is commonly used in microprocessor impeded systems.microprocessor impeded systems.

Hexadecimal NumbersHexadecimal Numbers

F111115

E111014

D110113

C110012

B101111

A101010

910019

810008

701117

601106

501015

401004

300113

200102

100011

000000

HexadecimalBinaryDecimal

Hexadecimal NumbersHexadecimal Numbers

�� The notation The notation ‘‘hh’’ is commonly used in is commonly used in

computer impeded system to stand computer impeded system to stand

for for hexadecimalhexadecimal numbers. numbers.

exampleexample

16h =(16)16h =(16) 1616 = 00010110= 00010110 22

0Dh =(AD)0Dh =(AD) 1616 = 10101101= 10101101 22

Hexadecimal NumbersHexadecimal Numbers�� BinBin--toto--Hex ConversionHex Conversion

•• Simply break the binary number into 4Simply break the binary number into 4--bit groups, starting bit groups, starting at the rightat the right--most bit and replace each 4most bit and replace each 4--bit group with the bit group with the equivalent hex symbol.equivalent hex symbol.

(a) 1100101001010111(a) 1100101001010111 (b) 111111000101101001(b) 11111100010110100111001100101010100101010101110111 0000111111111111000100010110011010011001

C C A A 5 5 77 3 3 F F 1 1 6 6 99

= CA57= CA571616 = 3F169= 3F1691616

Hexadecimal NumbersHexadecimal Numbers

�� HexHex--toto--Bin ConversionBin Conversion•• Reverse the process (of binReverse the process (of bin--toto--hex) and hex) and replace each hex symbol with its replace each hex symbol with its equivalent four bits.equivalent four bits.

ex: Determine the binary numbers for the following hex ex: Determine the binary numbers for the following hex numbers:numbers:

(a) 10A4h(a) 10A4h (b) CF8Eh(b) CF8Eh (c) 9742h(c) 9742h

1 1 00 A A 44 C C FF 8 8 EE 9 9 77 4 4 22

000000 1100000000 10101010 01000100 11001100 11111111 10001000 1110 1110 10011001 01110111 01000100 00100010

Hexadecimal NumbersHexadecimal Numbers

�� HexHex--toto--Dec ConversionDec Conversion

•• 2 methods:2 methods:

�� HexHex--toto--Bin first and then BinBin first and then Bin--toto--Dec.Dec.

�� Multiply the decimal values of each hex Multiply the decimal values of each hex

digits by its weight and then take the sum digits by its weight and then take the sum

of these products. of these products.

Hexadecimal NumbersHexadecimal Numbers

�� HexHex--toto--Dec ConversionDec Conversion•• HexHex--toto--Bin first and then BinBin first and then Bin--toto--DecDec

ex: Convert the following hex numbers to decimal:ex: Convert the following hex numbers to decimal:

(a) 1Ch(a) 1Ch

11CCh = h = 0001000111001100 = 16+8+4 = 28= 16+8+4 = 281010

(b) A85h(b) A85h

AA8855h = h = 101010101000100001010101 = 2048+512+128+4+1 = 2693= 2048+512+128+4+1 = 26931010

Hexadecimal NumbersHexadecimal Numbers�� HexHex--toto--Dec ConversionDec Conversion

•• Multiply the decimal values of each hex digits by its Multiply the decimal values of each hex digits by its weight and then take the sum of these products.weight and then take the sum of these products.

ex: Convert the following hex numbers to decimal:ex: Convert the following hex numbers to decimal:

(a) E5h(a) E5hE5h = (Ex16)+(5x1) = (14x16)+5 = 224+5 = 229E5h = (Ex16)+(5x1) = (14x16)+5 = 224+5 = 229 1010

(b) B2F8h(b) B2F8hB2F8h = (Bx4096)+(2x256)+(Fx16)+(8x1)B2F8h = (Bx4096)+(2x256)+(Fx16)+(8x1)

= (11x4096)+(2x256)+(15x16)+(8x1)= (11x4096)+(2x256)+(15x16)+(8x1)= 45,056+512+240+8 = 45,816= 45,056+512+240+8 = 45,8161010

Hexadecimal NumbersHexadecimal Numbers�� DecDec--toto--Hex conversionHex conversion

•• Repeated division of a Repeated division of a decdec number by number by

1616

ex: Convert the ex: Convert the decdec number 650 to hexnumber 650 to hex

650/16 = 650/16 = 4040..625625 0.6250.625x16 = 10 = x16 = 10 = AA

4040/16 = /16 = 22..55 0.50.5x16 = 8 = x16 = 8 = 88

22/16 = /16 = 00..125125 0.1250.125x16 = 2 = x16 = 2 = 22

Stop when whole number quotient is ZERO.

MSD

LSD

Hence 65010 = 28A h

Octal NumbersOctal Numbers

�� Like the hex, the Like the hex, the ““octoct””provides a convenient provides a convenient way to express binary way to express binary numbers and codes, numbers and codes, but not commonly but not commonly used. used.

�� It uses 8 digits: 0It uses 8 digits: 0--7 as 7 as in the table:in the table:

Octal NumbersOctal Numbers

�� BinBin--toto--Oct ConversionOct Conversion(a) 101110101(a) 101110101 (b) 1011011001 (b) 1011011001 Grouped into 3 digits and write the equivalent octal numberGrouped into 3 digits and write the equivalent octal number

(a) (a) 101101110110101101 (b) 1(b) 1011011011011001001((556655))88 ((11333311))88

�� OctOct--toto--Bin ConversionBin Conversion(a)(a) 131388 (b) 25(b) 2588 (c) 7526(c) 752688

(a)(a) 011011011 011 (b)(b) 010010101 101 (c) (c) 111111101101010010110110

�� OctOct--toto--Dec ConversionDec Conversion(a) 2374(a) 237488 = 2x8= 2x833 +3x8+3x822 +7x8+7x811 + 4x8+ 4x800

=1024+192+56+4=(1276)=1024+192+56+4=(1276)1010

�� DecDec--toto--Oct ConversionOct Conversion(a) 359(a) 3591010 =(447)=(447)88

The conversion to/from other bases follow the same rules as the hexadecimal ones, examples:-

44004/84/8

445544/844/8

774444359/8359/8

MSB

LSB

Remainder

Binary ArithmeticBinary Arithmetical Operational Operation

•• additionaddition

•• subtractionsubtraction

•• multiplicationmultiplication

•• divisiondivision

Binary AdditionBinary Addition�� The four basic rules for adding binary The four basic rules for adding binary

digits are as follows:digits are as follows:

•• 0+0=0+0= 00 �� sum of 0 with a carry of 0sum of 0 with a carry of 0

•• 0+1=0+1= 11 �� sum of 1 with a carry of 0sum of 1 with a carry of 0

•• 1+0=1+0= 11 �� sum of 1 with a carry of 0sum of 1 with a carry of 0

•• 1+1=1+1= 1100 �� sum of 0 with a carry of 1sum of 0 with a carry of 1

11 3+11 +3110 6

111 7+ 11 +31010 10

110 6+100 +41010 10

Binary SubtractionBinary Subtraction�� The four basic rules for subtracting The four basic rules for subtracting

binary digits are as follows:binary digits are as follows:

•• 00-- 0 = 0 = 00

•• 11-- 1 = 1 = 00

•• 11-- 0 = 0 = 11

•• 1010-- 1 = 1 = 11 ; 0; 0--1 with a borrow of 11 with a borrow of 1

11 3-01 -1

10 2

11 3-10 -2

01 1

101 5-011 -3

010 2

Binary MultiplicationBinary Multiplication�� The four basic rules for multiplying digits are as The four basic rules for multiplying digits are as follows:follows:

•• 0x0 = 0x0 = 00 0x1 = 0x1 = 00 1x0 = 1x0 = 00 1x1 = 1x1 = 11

�� Multiplication is performed with binary numbers Multiplication is performed with binary numbers in the same manner as with decimal numbers.in the same manner as with decimal numbers.

•• It involves forming partial products, shifting It involves forming partial products, shifting each successive partial product left one place, each successive partial product left one place, and then adding all the partial products.and then adding all the partial products.

11x11

11+111001

101x111

101101

+101100011

Binary DivisionBinary Division

�� Division in binary follows the same Division in binary follows the same

procedure as division in decimal.procedure as division in decimal.

1011 110

11000

1110 110

1010 1000

11’’s and 2s and 2’’s Complementss Complements�� Negative numbers are normally presented in 1Negative numbers are normally presented in 1’’s or 2s or 2’’s s

complementcomplement..

�� The method of 2The method of 2’’s complement arithmetic s complement arithmetic is commonly is commonly used in computerused in computer systemssystems to handle negative numbersto handle negative numbersmore than 1more than 1’’s complements complement..

Diminished Radix complement 11’’ss

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

complement of N is defined as (r n-1)-N.

Radix Complement: 2 ’’ss

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

To find the To find the 11’’s complements complement for a given binary numberfor a given binary number::

�� ComplementComplement every every bit in bit in thethe number the number the

result is result is 11’’s complement s complement

ex: find 1ex: find 1’’s complement of 11100101s complement of 1110010122

001100111100000011’’ s complements complement

1100110000111111BinaryBinary

Add 1 to the Add 1 to the 11’’s complements complement to get the to get the 22’’s complement.s complement.

ex: ex: 10110010 10110010 �������� 0100110101001101 �������� 0100111001001110

To find the To find the 22’’s complements complement for a given binary numberfor a given binary number::