Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.

Similar presentations

Presentation on theme: "CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina."— Presentation transcript:

1 CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina

2 Chapter 1: Introduction

3 8/20/20093 Digital Systems 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

4 8/20/20094

5 5 Examples 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

6 8/20/20096 Examples 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

7 8/20/20097 Truth Table Describe the behavior of a digital system in tabular form

8 8/20/20098 A Brief Review of Number Systems Integers are usually written using a positional number system N = a n-1 r n-1 + a n-2 r n-2 + … + a 2 r 2 + a 1 r + a 0 where 0  a i < r

9 8/20/20099 Conversion between Number Systems How to convert from binary to decimal? Evaluate the power series Example: 101011 2 = ?

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

11 8/20/200911

12 8/20/200912

13 8/20/200913 Hexadecimal Radix r = 16 Why use hexadecimal? Shorthand notation for binary Grouping 4 bits in binary to get 1 digit in hexadecimal

14 8/20/200914 Binary Addition

15 8/20/200915 One-bit Adder

16 8/20/200916 4-bit Adder

17 8/20/200917 Signed Numbers Signed-magnitude: human friendly, but causes complexity of arithmetic Two’s complement: store –a as the binary equivalent of 2 n –a in an n-bit system

18 8/20/200918 Two’s Complement An easier way to get two’s complement representation for a negative number 1. Find binary equivalent of the magnitude 2. Complement each bit (change 0’s to 1’s, and change 1’s to 0’s) 3. Add 1

19 8/20/200919 Addition using Two’s Complement It’s simple! Do the binary addition as usual If there is a carry out of the most significant bit, just ignore it But watch out for overflow! Overflow occurs when the sum is out of range, which indicates an error

20 8/20/200920

21 8/20/200921 Binary Subtraction Subtraction can be accomplished by 1.Taking the two’s complement of second operand 2.Adding the first operand and the two’s complement of second operand

22 8/20/200922 Overflow in Binary Subtraction For unsigned numbers, overflow occurs when the second number is larger than the first number, and is indicated by a carry out of 0 For signed numbers, overflow may occur if we subtract a negative number from a positive one or subtract a positive number from negative one

23 8/20/200923 Binary Coded Decimal (BCD) Most computers operate on binary numbers However, for computers to interface with humans, the mode of communication is generally decimal 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

24 8/20/200924 Binary-Coded Decimal Codes

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

26 8/20/200926

27 8/20/200927

Download ppt "CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina."

Similar presentations

Ads by Google