+ All Categories
Home > Documents > Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images...

Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images...

Date post: 28-Apr-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
69
©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems Digital Systems Digital systems have such a prominent role in everyday life “The digital age” The technology around us is “ubiquitous”, that is we don’t even notice it anymore Digital systems are used in: communication, business transactions, traffic control, spacecraft guidance, medical treatment, weather monitoring, the Internet, and many other commercial, industrial, and scientific enterprises We have: digital telephones, digital televisions, digital versatile discs, digital cameras, handheld devices, and of course, digital computers, etc.
Transcript
Page 1: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1

Digital SystemsDigital Systems• Digital systems have such a prominent role in

everyday life• “The digital age”• The technology around us is “ubiquitous”, that is we

don’t even notice it anymore• Digital systems are used in:

• communication, business transactions, traffic control, spacecraft guidance, medical treatment, weather monitoring, the Internet, and many other commercial, industrial, and scientific enterprises

• We have:• digital telephones, digital televisions, digital versatile

discs, digital cameras, handheld devices, and of course, digital computers, etc.

Page 2: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 2

Digital SystemsDigital Systems• We enjoy music and video downloaded directly to our

portable media devices (phones) which have very high resolution displays via complex digital communications networks (4G, LTE)

• These devices have advanced graphical user interfaces (GUIs), which enable them to execute commands that appear to the user to be simple, but which, in fact involve precise execution of a sequence of complex internal instructions• Your phone’s OS is over 3GB in size!

• These devices have a general purpose digital computer embedded within them• Also contains specific components such as a radio,

audio/video encoders/decoders, 3D graphics subsystems

Page 3: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 3

Digital SystemsDigital Systems• The digital computer can follow a sequence of instructions,

called a program• The user can specify and change the program or the

data according to the specific need• Because of this flexibility, the general purpose digital

computer can perform a variety of information processing tasks that range over a wide spectrum of applications

• Digital systems manipulate discrete elements of information• Any set that is restricted to a finite number of elements• Examples: 10 decimal digits, 26 letters of the alphabet,

52 playing cards, 64 squares of a chessboard

Page 4: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 4

Digital SystemsDigital Systems• Early digital computers were used strictly for

numeric computations (for which “computer” was derived)

• Discrete elements of information are represented in a digital system by physical quantities called signals which are usually represented as voltages and currents

• Digital systems today generally use just two discrete values and are therefore said to be binary

• A binary digit, called a bit, has two values: 0 and 1

Page 5: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 5

Digital SystemsDigital Systems• Discrete elements of information are represented

with groups of bits called binary codes• Decimal digits 0 through 9 could be represented in a

digital system with four bits• How a pattern of bits is interpreted as a number

depends on the code system in which it resides• Discrete quantities of information either emerge

from the nature of the data being processed or may be quantized from a continuous process

• The quantization of a process can be performed automatically by an analog-to-digital converter, a device that forms a digital (discrete) representation of an analog (continuous) quantity

Page 6: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 6

Digital SystemsDigital Systems• The general purpose digital computer is the best

known example of a digital system• The major parts of a computer are a memory unit, a

central processing unit, and input-output units• Memory unit stores programs, input, output, and

intermediate data• Central processing unit performs arithmetic and data

movement• Program and data are transferred into memory by an

input device• An output device receives the results of the

computations• A digital computer can accommodate many input

and output devices

Page 7: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 7

Digital SystemsDigital Systems• A digital computer is a powerful instrument that can

perform not only arithmetic computations, but also logical operations

• It can be programmed to make decisions based on internal and external conditions

• By changing the program the same underlying hardware can be used for many different applications• The cost of development to be spread across a wider

customer base• Advances in digital integrated circuit technology have

reduced overall costs• As the number of transistors that can be put on a piece of

silicon increases to produce complex functions, the cost per unit decreases and digital devices can be bought at an increasingly reduced price

Page 8: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 8

Digital SystemsDigital Systems• Digital integrated circuits can perform at a

speed of hundreds of millions of operations per second

• To improve reliability digital systems often utilize error correcting codes

• For example:• Digital communications include additional bits to

verify the proper transmission of information• All digital storage includes additional bits of

information which are used to not only verify but reconstruct data which has been damaged

Page 9: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 9

Digital SystemsDigital Systems• A digital system is an interconnection of digital

modules• It is necessary to have a basic knowledge of digital

circuits and their logical function to understand the overall operation of each digital module

• Modern day digital design methodology uses hardware description languages (HDLs) to describe and simulate the functionality of a digital circuit• Resembles a programming language and is suitable

for describing digital circuits in textual form• Used to simulate a digital system to verify its operation

before hardware is built• Also used with logic synthesis tools to automate the

design process

Page 10: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 10

Digital SystemsDigital Systems• Digital systems manipulate discrete quantities of

information that are represented in binary form • Operands used for calculations may be expressed

in the binary number system• Other discrete elements, including the decimal

digits and characters of the alphabet, are represented in binary codes

• Digital circuits, also referred to as logic circuits, process data by means of binary logic elements (logic gates) using binary signals

• Quantities are stored in binary (two-valued) storage elements (flip-flops)

Page 11: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 11

Number RepresentationsNumber Representations• Series of digits where the placement of the digits

indicates its magnitude or significance• ai is the digit, r is the base, i is the position or

significance (lower is less), n is the number of digits

• For the decimal system, r = 10• Each digit ranges from 0 to 9

1

0

, 0n

ii i

i

y a r a r

Page 12: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 12

Decimal Number SystemDecimal Number System

• Example: r = 10• y = 7392(10)

• a0 = 2, the ones column• a1 = 9, the tens column• a2 = 3, the hundreds column• a3 = 7, the thousands column

3 2 1 03 2 1 0

3 2 1 0

3 2 1 0

7 10 3 10 9 10 2 10" " 7392

y a r a r a r a r

yy a a a a

Page 13: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 13

Decimal Number SystemDecimal Number System• Example: r = 10

• y = 26.75(10)

• a-2 = 5, the hundredths column• a-1 = 7, the tenths column• a0 = 6, the ones column• a1 = 2, the tens column

• Radix point distinguishes where the positive powers switch to negative

1 0 1 21 0 1 2

1 0 1 2

1 0 1 2

2 10 6 10 7 10 5 10" . " 26.75

y a r a r a r a r

yy a a a a

Page 14: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 14

Binary NumberBinary Numberss

• Digital systems represent information in “0”s and “1”s

• Almost always built with transistors• Circuits operate as switches (“0”=off, “1”=on)

• Discrete levels compensate for electronic noise and power fluctuations• E.g. “0” is from 0V to 2V, “1” is from 3V to 5V

Page 15: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 15

Binary Number System (Binary Number System (rr = 2)= 2)

• Example: r = 2• y = 11010.11(2)

• Always refer to bit positions from right to left (negative to positive)

4 3 2 1 0

1 2

(10)

1 2 1 2 0 2 1 2 0 21 2 1 2

26.75

y

Page 16: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 16

Other Number SystemOther Number System• Base 5:

• Digits between 0 and 4

• Base 8:• Digits between 0 and 7

• Base 16:• Digits between 0 and 9, A and F (10 to 15)

2 1 0 1(8) (10)127.4 1 8 2 8 7 8 4 8 87.5

3 2 1 0 1(5) (10)4021.2 4 5 0 5 2 5 1 5 2 5 511.4

3 2 1 0(16) (10)B65F 11 16 6 16 5 16 15 16 46687

Page 17: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 17

Binary Number SystemBinary Number System

• When converting from binary, you can skip “0” bits since they don’t contribute:

(2) (10)110101 32 16 4 1 53

Page 18: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 18

Binary ArithmeticBinary Arithmetic

• Binary operations follow the same rules as decimal

• Remember to use the proper digits! (0 & 1)

Page 19: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 19

Number Base ConversionsNumber Base Conversions• Convert 41(10) to binary (base 2)

• Starting at position 0• Divide value by “r”• Integer Remainder become coefficient• Integer Quotient becomes next value• Repeat until next value is 0

• Solution is 101001(2)

a5 = 1101/2

a4 = 0012/2

a3 = 1125/2

a2 = 00510/2

a1 = 001020/2

a0 = 112041/2

CoefficientInteger RemainderInteger Quotient

Page 20: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 20

Number Base ConversionsNumber Base Conversions

• Convert 153(10) to octal (base 8)

• Convert 41394(10) to hexadecimal (base 16)a2 = 2202/8

a1 = 33219/8

a0 = 1119153/8

CoefficientInteger RemainderInteger Quotient

a2 = 1 = “1”110161/16

a3 = 10 = “A”10010/16

a1 = 11 = “B”111612587/16

a0 = 2 = “2”2258741394/16

CoefficientInteger RemainderInteger Quotient

Page 21: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 21

Number Base ConversionsNumber Base Conversions• Convert 0.6875(10) to binary (base 2)

• Starting at position -1• Multiple value by “r”• Integer Product becomes coefficient• Fraction becomes next value• Repeat until next value is 0

• Solution is 0.1011(2)

a-4 = 1010.5000 x 2

a-3 = 10.500010.7500 x 2

a-2 = 00.750000.3750 x 2

a-1 = 10.375010.6875 x 2

CoefficientFractionInteger Product

Page 22: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 22

Number Base ConversionsNumber Base Conversions

• Convert 0.513(10) to octal (base 8)

• Solution is 0.406517...(8)

a-3 = 60.65660.832 x 8

a-4 = 50.24850.656 x 8

a-5 = 10.98410.248 x 8

a-6 = 70.87270.984 x 8

.........0.872 x 8

a-2 = 00.83200.104 x 8

a-1 = 40.10440.513 x 8

CoefficientFractionInteger Product

Page 23: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 23

Number Base ConversionsNumber Base Conversions

• Full solution:• .40651767635544264162540203044672274324

773716662132071260101422335136152375747331055034530040611156457(8)

• Not every base gives a compact answer• Base 10 was certainly smaller!

Page 24: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 24

Number Base ConversionsNumber Base Conversions

• Conversion of both integer and fraction parts is done separately and then combining the two answers

• For example:41.6875(10) = 101001.1011(2)

153.513(10) = 231.406517...(8)

Page 25: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 25

Octal and Hexadecimal NumbersOctal and Hexadecimal Numbers• Octal:011001100101111.000110010(2)011 001 100 101 111 . 000 110 010(2)3 1 4 5 7 . 0 6 2(8)31457.062(8)

• Hexadecimal:0110011001011110.00110010(2)0110 0110 0101 1110 . 0011 0010(2)6 6 5 E . 3 2(16)665E.32(16)

Page 26: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 26

Octal and Hexadecimal NumbersOctal and Hexadecimal Numbers

Page 27: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 27

Complements of NumbersComplements of Numbers• The larger a circuit becomes, generally the slower

it becomes• Complements are used to simplify subtraction

• Two types:• Diminished Radix Complement

• (r-1)’s complement (1’s complement in binary, 9’s complement in decimal)

• Radix Complement• r’s complement (2’s complement in binary, 10’s complement in

decimal)

Page 28: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 28

Diminished Radix ComplementDiminished Radix Complement• Given N in base r having n digits• (r-1)’s complement of N is:

• For example (r=10,n=7):9’s complement of 0546700 is:9999999-0546700=94532999’s complement of 0012398 is:9999999-0012398=9987601

1nr N

Page 29: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 29

Diminished Radix ComplementDiminished Radix Complement• For example (r=2,n=8):

1’s complement of 01011000 is:11111111-01011000=101001111’s complement of 00101101 is:11111111-00101101=11010010

• Quick way: “Invert the bits”1’s complement of 01011000 is 101001111’s complement of 00101101 is 11010010

• For octal or hexadecimal, subtract each digit from 7 or “F” (15 decimal) respectively

Page 30: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 30

Radix ComplementRadix Complement

• Given N in base r having n digits• r’s complement of N is:

• Can also be obtained by adding 1 to the diminished radix complement since:

, 00, 0

nr N NN

1 1n nr N r N

Page 31: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 31

Radix ComplementRadix Complement

• For example (r=10,n=7):10’s complement of 0546700

• Add extra 0’s at front to make 7 digits9’s complement of 0546700 is 945329910’s complement is 9453299+1=9453300

10’s complement of 0012398• Add extra 0’s at front to make 7 digits

9’s complement of 0012398 is 998760110’s complement is 9987601+1=9987602

Page 32: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 32

Radix ComplementRadix Complement• Quick way:

• Leave all least significant 0’s unchanged• Subtract first nonzero least significant digit from

10• Subtract all higher significant digits from 9

• 10’s complement of 0246700• Leave last 2 zeros unchanged to get “00”• Subtract 7 from 10 to get “3”• Subtract “0246” digits from 9’s to get “9753”• Combine to get “9753300”

Page 33: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 33

Radix ComplementRadix Complement

• For example (r=2, and n=8):2’s complement of 01011000

• Add extra 0’s at front to make 8 digits

1’s complement is 11111111-01011000=101001112’s complement is 10100111+1=10101000

2’s complement of 00101101• Add extra 0’s at front to make 8 digits

1’s complement is 11111111-00101101=110100102’s complement is 11010011

Page 34: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 34

Radix ComplementRadix Complement• Quick way:

• Leave all least significant 0s and first 1 unchanged

• Invert remaining

• 2’s complement of 01101100• 10010100

• 2’s complement of 00110111• 11001001

Page 35: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 35

Radix ComplementRadix Complement

• When a radix point is present• Remove point• Perform complement• Place point back in original place• Essentially ignore it

• The complement of a complement restores the number to its original value

Page 36: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 36

Subtraction with ComplementsSubtraction with Complements• To subtract two n-digit unsigned numbers “M -

N” in base r:1. Add the minuend M to the r’s complement of the

subtrahend N:M + ( rn - N ) = M - N + rn

2. If there is a carry (rn or n+1th digit), discard it3. If nth digit is not zero, solution is in r’s

complement• Take r’s complement to get absolute value and place a

negative sign in front to get normal form

Page 37: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 37

Subtraction with Radix ComplementsSubtraction with Radix Complements

• Solve: 072532 - 003250 (r=10,n=6)

69282=Answer-1000000=Discard n+1th digit1069282=Sum

+ 996750=10’s complement of N072532=M

Page 38: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 38

Subtraction with Radix ComplementsSubtraction with Radix Complements• Solve: 003250 - 072532 (r=10,n=6)

-69282=Place negative sign

069282=nth digit not zero, do 10’s complement of Sum

930718=Sum+ 927468=10’s complement of N

003250=M

Page 39: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 39

Subtraction with Radix ComplementsSubtraction with Radix Complements

• r = 2, n = 8, X = 1010100, Y = 1000011• Find: X - Y

10001=Answer-100000000=Discard n+1th digit100010001=Sum

+ 10111101=2’s complement of Y01010100=X

Page 40: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 40

Subtraction with Radix ComplementsSubtraction with Radix Complements

• r = 2, n = 8, X = 1010100, Y = 1000011• Find: Y - X

-10001=Place negative sign

00010001=nth digit not zero, do 2’s complement of Sum

11101111=Sum+ 10101100=2’s complement of X

01000011=Y

Page 41: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 41

Subtraction with Diminished Radix Subtraction with Diminished Radix ComplementsComplements

• r = 2, n = 8, X = 1010100, Y = 1000011• Find: X - Y

10001=Answer

+1=Move n+1th digit to first column (end-around carry)

100010000=Sum+ 10111100=1’s complement of Y

01010100=X

Page 42: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 42

Subtraction with Diminished Radix Subtraction with Diminished Radix ComplementsComplements

• r = 2, n = 8, X = 1010100, Y = 1000011• Find: Y - X

-10001=Place negative sign

00010001=nth digit not zero, do 1’s complement of Sum

11101110=Sum+ 10101011=1’s complement of X

01000011=Y

Page 43: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 43

Signed Binary NumbersSigned Binary Numbers

• Range is –(2(n-1)) to 2(n-1)-1

Page 44: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 44

Arithmetic Addition (2Arithmetic Addition (2’’s comp)s comp)• Carry out is discarded• Make sure we have enough bits or an overflow will

be generated

Page 45: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 45

Arithmetic Subtraction (2Arithmetic Subtraction (2’’s comp)s comp)

• Do the same as addition except perform subtraction

• Discard the “borrow”• Beneficial since we don’t need to make a

decision on which operation to do based on the signs

• Binary adders and subtractors can be combined to obtain more savings in circuit implementation

Page 46: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 46

Binary CodesBinary Codes• Digital systems use signals that have two distinct

values and circuit elements that have two stable states• Direct analogy among binary signals, binary circuit

elements, and binary digits• A binary number of n digits may be represented by

n binary circuit elements; each a “0” or “1”• Digital systems represent and manipulate not only

binary numbers but also many other discrete elements of information

• Any discrete element of information that is distinct among a group of quantities can be represented with a binary code; a pattern of 0’s and 1’s

Page 47: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 47

Binary CodesBinary Codes• Due to technology limitations, codes must be in binary• Binary codes merely change the symbols and not the

meaning of the elements of information that they represent

• Most bits of a digital system represent some type of coded information rather than just binary numbers

• An n-bit binary code is a group of n bits that assumes up to 2n distinct combinations of 1’s and 0’s, with each combination representing one element of the set that is being coded• Four elements can be coded with two bits: 00, 01, 10, 11• Eight elements requires a three bit code• Sixteen elements requires a four bit code

Page 48: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 48

Binary CodesBinary Codes• The bit combination of an n-bit code is determined from the

count in binary from 0 to 2n - 1• Each element must be assigned a unique binary bit combination• No two elements can have the same value or the code

assignment will be ambiguous• Minimum number of bits required to code 2n distinct values is n• No maximum number of bits that may be used

• For example, the 10 decimal digits can be coded with 10 bits, and each decimal digit can be assigned a bit combination of nine 0’s and a 1 (one hot)• The bit combination 0001000000 represents 6

Page 49: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 49

Binary Coded DecimalBinary Coded Decimal• “r=BCD”• Perform computation directly

on “decimal” information• Avoid conversion between

binary and decimal• Can save time on slower

systems• Each digit takes 4 bits; 6 of

16 states unused

Page 50: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 50

BCD AdditionBCD Addition• If the addition of two digits exceeds “9”, need to correct by

adding “6”• This may produce a new digit or add to an existing digit• Carry propagation may continue onward to higher

significant digits

Page 51: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 51

BCD AdditionBCD Addition• Solve: 184 + 576

• Carry is sent to next column

Page 52: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 52

Other Decimal CodesOther Decimal Codes

Page 53: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 53

Other Decimal CodesOther Decimal Codes• BCD8421 code has weights 8, 4, 2, and 1

• 8x0 + 4x1 + 2x1 + 1x0 = 6• BCD2421 has weights 2, 4, 2, and 1

• 2x1 + 4x1 + 2x0 + 1x1 = 7• Have duplicate representations: 0100 & 1010 = 4,

0101 & 1011 = 5, etc.• Excess-3 adds 3 to BCD8421• Excess-3 and BCD2421 are self complementing so

9’s complement is easily achieved by inverting bits• 84-2-1 assigns both positive and negative weights

• 8x0 + 4x1 - 2x1 - 1x0 = 2

Page 54: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 54

Gray CodeGray Code• Only one bit changes in going

from one number to the next• ie. 7 (0111) to 8 (1000) in binary

requires 4 bit changes whereas 7 to 8 in gray code requires just 1

• Traditionally used in applications where many bit changes could have produced errors• Analog/asynchronous designs• Not an issue today with mostly

digital systems

Page 55: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 55

American Standard Code for American Standard Code for Information Interchange (ASCII)Information Interchange (ASCII)

Page 56: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 56

American Standard Code for American Standard Code for Information Interchange (ASCII)Information Interchange (ASCII)

Page 57: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 57

American Standard Code for American Standard Code for Information Interchange (ASCII)Information Interchange (ASCII)

• ASCII is 7 bits• Additional bit made each character 8 bits

• Bit used for more characters such as Greek letters or graphical symbols

• This has all been replaced by UNICODE which uses 16 or 32 bits per character

• Additional bit was also used for error detection using simple parity system:

• It can only detect 1, 3, 5, or 7 incorrect bits• Simple but not used in modern technology

Page 58: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 58

Binary Storage and RegistersBinary Storage and Registers• Information needs to be stored in binary due to

modern technology limitations• A group of binary cells is called a register

• An n-bit register can store up to 2n possibilities• Modern technology groups information into 8-bits or

a byte• Advancements have transitioned from 1 to 2 to 4 to 8

bytes since it is easy to “double up”• ASCII uses 1 byte• UNICODE may use 2 or 4• Floating point may use 4 or 8 or more

• The amount of bits has to be determined for each application

Page 59: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 59

Register TransferRegister Transfer• Register transfer is a

basic operation which moves information from one register to another• It may be a direct copy or

may be processed before• They essentially hold data

• Example:• A keyboard sending data

(with odd parity) to a control circuit which stores the information every time a key is pressed

• Pressed key is shifted 8 bits to the left and stored in memory

Page 60: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 60

Register TransferRegister Transfer• Example:

• Memory unit holds millions of registers

• Processing unit takes 2 operands (R1, R2) and adds them and places them sum in (R3)

• The memory unit cannot perform any processing; it only stores information

• Transfer information from the memory unit to the processing unit, process it, and store it back

• The process is not immediate; it takes many steps

Page 61: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 61

Binary LogicBinary Logic• Binary logic deals with variables that take on two

discrete values and with operations that assume logical meaning• Two values may be called by different names: true and

false, yes and no, etc.• Use the values 1 and 0

• The binary logic is equivalent to Boolean algebra• More formal presentation in Chapter 2

• Binary logic consists of binary variables and a set of logic operations• Variables are: A, B, C, x, y, z, etc. each having two

distinct values (0 or 1)• Three operations are AND, OR, and NOT

Page 62: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 62

Definition of Binary LogicDefinition of Binary Logic• AND: Represented by a dot or by the absence of an operator

• For example, z = x · y or z = xy, is read “z is equal to x AND y”• Interpreted to mean that z = 1 if and only if x = 1 and y = 1;

otherwise z = 0• OR: Represented by a plus sign

• For example, z = x + y, is read “z is equal to x OR y”• Interpreted to mean that z = 1 if x = 1 or if y = 1 or if both x = 1

and y = 1; otherwise z = 0• NOT: Represented by a prime after or an overbar or a slash

before• For example: z = x' or z = ͞x or z = /x, is read “z is equal to not

x” or “z is not equal to x”• Interpreted to mean if x = 1, then z = 0, but if x = 0, then z = 1• Also referred to as the complement operation, since it changes

a 1 to 0 and a 0 to 1

Page 63: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 63

Definition of Binary LogicDefinition of Binary Logic• Binary logic resembles binary arithmetic, and the

operations AND and OR have similarities to multiplication and addition, respectively• The symbols used for AND and OR are the same as

those used for multiplication and addition• Binary logic should not be confused with binary

arithmetic• Arithmetic variable designates a number that may

consist of many digits• A logic variable is always either 1 or 0

• For example:• Binary arithmetic: 1 + 1 = 10• Binary logic: 1 + 1 = 1

Page 64: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 64

Definition of Binary LogicDefinition of Binary Logic• For each combination of the values of x and y, there is a value of

z specified by the definition of the logical operation• Listed in a compact form called truth tables• A table of all possible combinations of the variables, showing the

relation between the values that the variables may take and the result of the operation

• The truth tables for the operations AND, OR, and NOT with variable(s) (x and y) are obtained by listing all possible values that the variables may have when combined in pairs:

Page 65: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 65

Logic GatesLogic Gates• Logic gates are electronic

circuits that operate on one or more input signals to produce an output signal

• Electrical signals exist as analog signals having values over a given continuous range but are interpreted to be either of two recognizable values, 0 or 1 for digital systems

• Modern day technology uses voltages to determine values; for example:• Logic 0 is from 0 V to 1 V• Logic 1 is from 2 V to 3 V

Page 66: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 66

Logic GatesLogic Gates• The input terminals of digital

circuits accept binary signals within the allowable range and respond at the output terminals with binary signals that fall within the specified range

• The intermediate region between the allowed regions is crossed only during a state transition

• Any information for computing or control can be operated on by passing binary signals through various combinations of logic gates

Page 67: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 67

Logic GatesLogic Gates• Graphic symbols of gates shown below• Gates are blocks of hardware that produce proper 0

and 1 signals given proper input signals• Each gate is made up by a series of transistors

• Some gates require more transistors and therefore more space

• Current technology only allows for transistors to be constructed on a single plane

Page 68: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 68

Logic GatesLogic Gates• The input signals x and y in

the AND and OR gates may exist in one of four possible states: 00, 10, 11, or 01

• These input signals are shown together with the corresponding output signal for each gate

• Timing diagrams illustrate the idealized response of each gate to the four input signal combinations• Horizontal axis represents the

time, and the vertical axis shows the signal as it changes between the two possible voltage levels

• In reality the transitions between logic values occur quickly, but not instantaneously nor are they perfectly “square”• Low level represents logic 0• High level represents logic 1

Page 69: Digital Systems - R. Muscedere Courses · 2021. 1. 7. · ©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 1 Digital Systems • Digital systems have such a prominent

©2018-2021 Roberto Muscedere Images ©2013 Pearson Education Inc. 69

Logic GatesLogic Gates• AND and OR gates may have more than two inputs• The three input AND gate responds with logic 1 output if

all three inputs are logic 1; otherwise the output produces logic 0

• The four input OR gate responds with logic 1 if any input is logic 1; otherwise the output produces a 0

• In practice no more than 3 inputs are used since it slows down the gate• Multiple gates are cascaded to generate the same result


Recommended