CSCE 211 Digital Logic Design ChinTser Huang huangctcse

  • Slides: 23
Download presentation
CSCE 211: Digital Logic Design Chin-Tser Huang huangct@cse. sc. edu University of South Carolina

CSCE 211: Digital Logic Design Chin-Tser Huang huangct@cse. sc. edu University of South Carolina

Chapter 1: Introduction

Chapter 1: Introduction

Digital Systems n n They are everywhere! They are usually binary: operating on two-valued

Digital Systems n n They are everywhere! They are usually binary: operating on two-valued signals Take an arbitrary number of inputs and produce an arbitrary number of outputs Some systems require a timing signal called clock 08/20/2015 3

08/20/2015 4

08/20/2015 4

Examples n n A system with three inputs, A, B, and C, and one

Examples n n A system with three inputs, A, B, and C, and one output Z, such that Z = 1 if and only if two of the inputs are 1 A system with eight inputs, representing two 4 -bit binary numbers, and one 5 -bit output, representing the sum 08/20/2015 5

Examples n n A system with one input, A, plus a clock, and one

Examples n n A system with one input, A, plus a clock, and one output, Z, which is 1 iff the input was one at the last three consecutive clock times A traffic controller on two streets: the light is green on each street for a fixed period of time, then goes to yellow for another fixed period and finally to red. The only input to this system is the clock 08/20/2015 6

Truth Table n Describe the behavior of a digital system in tabular form 08/20/2015

Truth Table n Describe the behavior of a digital system in tabular form 08/20/2015 7

08/20/2015 8

08/20/2015 8

A Brief Review of Number Systems n Integers are usually written using a positional

A Brief Review of Number Systems n Integers are usually written using a positional number system N = an-1 rn-1 + an-2 rn-2 + … + a 2 r 2 + a 1 r + a 0 where 0 ai < r 08/20/2015 9

Conversion between Number Systems n How to convert from binary to decimal? Evaluate the

Conversion between Number Systems n How to convert from binary to decimal? Evaluate the power series n Example: 1010112 = ? 08/20/2015 10

Conversion between Number Systems n How to convert from decimal to binary? Two algorithms

Conversion between Number Systems n How to convert from decimal to binary? Two algorithms 1. 2. 08/20/2015 Repeatedly subtract from the number the largest power of 2 less than that number and put a 1 in corresponding position Repeatedly divide the number by 2 and put the remainder from right to left 11

08/20/2015 12

08/20/2015 12

08/20/2015 13

08/20/2015 13

Hexadecimal n n n Radix r = 16 Why use hexadecimal? Shorthand notation for

Hexadecimal n n n Radix r = 16 Why use hexadecimal? Shorthand notation for binary Grouping 4 bits in binary to get 1 digit in hexadecimal 08/20/2015 14

Binary Addition 08/20/2015 15

Binary Addition 08/20/2015 15

One-bit Adder 08/20/2015 16

One-bit Adder 08/20/2015 16

4 -bit Adder 08/20/2015 17

4 -bit Adder 08/20/2015 17

Overflow n n Overflow occurs when the result of an arithmetic operation is out

Overflow n n Overflow occurs when the result of an arithmetic operation is out of range and indicates an error For example, in a computer with n-bit words, if the addition of two n-bit integers produces an (n+1)-bit result, we call it overflow 08/20/2015 18

Binary Coded Decimal (BCD) n n Most computers operate on binary numbers However, for

Binary Coded Decimal (BCD) n n Most computers operate on binary numbers However, for computers to interface with humans, the mode of communication is generally decimal n n n Convert from decimal to binary on input Convert from binary to decimal on output But the decimal output still needs to be coded into binary, digit by digit 08/20/2015 19

Binary-Coded Decimal Codes 08/20/2015 20

Binary-Coded Decimal Codes 08/20/2015 20

Other Codes n n ASCII: used to transmit alphanumeric information Gray code: consecutive numbers

Other Codes n n ASCII: used to transmit alphanumeric information Gray code: consecutive numbers differ in only one bit n Particularly useful in coding the position of a continuous device and error detection 08/20/2015 21

08/20/2015 22

08/20/2015 22

08/20/2015 23

08/20/2015 23