Instructor: Alexander Stoytchev

Slides:



Advertisements
Similar presentations
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Advertisements

Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
Combinational Circuits
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
XOR, XNOR, and Binary Adders
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
XOR Function Logic Symbol  Description  Truth Table 
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Presentation transcript:

Instructor: Alexander Stoytchev CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/

Serial Adder CprE 281: Digital Logic Iowa State University, Ames, IA Copyright © Alexander Stoytchev

Administrative Stuff Homework 10 is out It is due on Monday Nov 17, 2014

Quick Review

(there are four possible cases) Adding two bits (there are four possible cases) [ Figure 3.1a from the textbook ]

Adding two bits (the truth table) [ Figure 3.1b from the textbook ]

Adding two bits (the logic circuit) [ Figure 3.1c from the textbook ]

The Half-Adder [ Figure 3.1c-d from the textbook ]

Addition of multibit numbers Bit position i [ Figure 3.2 from the textbook ]

Problem Statement and Truth Table [ Figure 3.2b from the textbook ] [ Figure 3.3a from the textbook ]

Let’s fill-in the two K-maps [ Figure 3.3a-b from the textbook ]

Let’s fill-in the two K-maps [ Figure 3.3a-b from the textbook ]

The circuit for the two expressions [ Figure 3.3c from the textbook ]

This is called the Full-Adder [ Figure 3.3c from the textbook ]

XOR Magic

XOR Magic

XOR Magic Can you prove this?

(si can be implemented in two different ways) XOR Magic (si can be implemented in two different ways)

A decomposed implementation of the full-adder circuit HA c x i HA c c y i + 1 i (a) Block diagram c i s i x i y i c i + 1 (b) Detailed diagram [ Figure 3.4 from the textbook ]

The Full-Adder Abstraction HA c x i c i 1 + HA c y i

The Full-Adder Abstraction FA x i c i 1 + y i

We can place the arrows anywhere xi yi ci+1 FA ci si

n-bit ripple-carry adder x y x y x y n – 1 n – 1 1 1 c 1 c c n FA c n ” 1 2 FA FA c s s s n – 1 1 MSB position LSB position [ Figure 3.5 from the textbook ]

n-bit ripple-carry adder abstraction x y x y x y n – 1 n – 1 1 1 c 1 c c n FA c c n ” 1 2 FA FA s s s n – 1 1 MSB position LSB position

n-bit ripple-carry adder abstraction x y x y x y n – 1 n – 1 1 1 c c n s s s n – 1 1

The x and y lines are typically grouped together for better visualization, but the underlying logic remains the same x n – 1 c n y – s

Serial Adder The n-bit adder requires all bits to be provided at the same time. In some cases we may want to add the numbers as the bits come in. Also, with an n-bit adder we are limited to n-bits. Circuits for larger n are more complex. Can we add arbitrarily long numbers.

Block diagram for the serial adder Shift register s Adder FSM Shift register Shift register b Sum = A + B B Clock [ Figure 6.39 from the textbook ]

State diagram for the serial adder FSM [ Figure 6.40 from the textbook ]

State diagram for the serial adder FSM [ Figure 6.40 from the textbook ]

State diagram for the serial adder FSM [ Figure 6.40 from the textbook ]

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM

State diagram for the serial adder FSM State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 [ Figure 6.40 & 6.41 from the textbook ]

State diagram for the serial adder FSM State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 [ Figure 6.40 & 6.41 from the textbook ]

State diagram for the serial adder FSM State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 [ Figure 6.40 & 6.41 from the textbook ]

State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 [ Figure 6.41 from the textbook ]

State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 State-assigned table for the serial adder Present Next state Output state ab =00 01 10 11 00 y Y s 1 [ Figure 6.41 & 6.42 from the textbook ]

State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 State-assigned table for the serial adder Present Next state Output state ab =00 01 10 11 00 y Y s 1 [ Figure 6.41 & 6.42 from the textbook ]

State table for the serial adder FSM Present Next state Output s state ab =00 01 10 11 00 G H 1 State-assigned table for the serial adder Present Next state Output state ab =00 01 10 11 00 y Y s 1 [ Figure 6.41 & 6.42 from the textbook ]

Derivation of Y and s Present Next state Output state ab =00 01 10 11 1

Derivation of Y and s Present Next state Output state ab =00 01 10 11 1 y a b Y s 1

Derivation of Y and s Present Next state Output state ab =00 01 10 11 1 y a b Y s 1

Derivation of Y and s Present Next state Output state ab =00 01 10 11 1 y a b Y s 1 b 00 01 11 10 1 y a Y b 00 01 11 10 1 y a s

Derivation of Y and s Present Next state Output state ab =00 01 10 11 1 y a b Y s 1 b 00 01 11 10 1 y a Y b 00 01 11 10 1 y a s

Derivation of Y and s Present Next state Output state ab =00 01 10 11 1 y a b Y s 1 b 00 01 11 10 1 y a Y b 00 01 11 10 1 y a s

Derivation of Y and s Y = ab + ay + by s = XOR(XOR(a, b), y) Present Next state Output state ab =00 01 10 11 00 y Y s 1 y a b Y s 1 b 00 01 11 10 1 y a Y b 00 01 11 10 1 y a s Y = ab + ay + by s = XOR(XOR(a, b), y)

Circuit for the serial adder FSM Full b adder Y y D Q carry-out Clock Q Reset Y = ab + ay + by s = XOR(XOR(a, b), y) [ Figure 6.43 from the textbook ]

Moore Machine Implementation

State diagram for the Moore-type serial adder FSM 1 s = ¤ Reset 01 10 11 G 00 [ Figure 6.44 from the textbook ]

State diagram for the Moore-type serial adder FSM 1 s = ¤ Reset 01 10 11 G 00 carry=0, sum=0 carry=1, sum=0 carry=0, sum=1 carry=1, sum=1 [ Figure 6.44 from the textbook ]

State diagram for the Moore-type serial adder FSM 1 s = ¤ Reset 01 10 11 G 00 carry=0, sum=0 carry=1, sum=0 carry=0, sum=1 carry=1, sum=1 [ Figure 6.44 from the textbook ]

State table for the Moore-type serial adder FSM Present Nextstate Output state ab =00 01 10 11 s G 1 H H 1 s = ¤ Reset 01 10 11 G 00 [ Figure 6.45 from the textbook ]

State table for the Moore-type serial adder FSM Present Nextstate Output state ab =00 01 10 11 s G 1 H [ Figure 6.45 from the textbook ]

State table for the Moore-type serial adder FSM Present Nextstate Output state ab =00 01 10 11 s G 1 H Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 [ Figure 6.45 & 6.46 from the textbook ]

State table for the Moore-type serial adder FSM Present Nextstate Output state ab =00 01 10 11 s G 1 H Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 [ Figure 6.45 & 6.46 from the textbook ]

for the Moore-type serial adder FSM State-assigned table for the Moore-type serial adder FSM Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 [ Figure 6.46 from the textbook ]

Deriving Y1, Y2, and s Present Nextstate state ab =00 01 10 11 Output 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00

Deriving Y1 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00

Deriving Y1 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00

Deriving Y1 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 y 2 1 a b

Deriving Y1 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 1 y 2 a b

Deriving Y1 Y1 = a + b + y2 Present Nextstate state ab =00 01 10 11 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 1 y 2 a b Y1 = a + b + y2

Deriving Y2 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00

Deriving Y2 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00

Deriving Y2 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 y 2 1 a b

Deriving Y2 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 1 y 2 a b

Deriving Y2 Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 1 y 2 a b

Deriving Y2 Y2 = ab + ay2 + by2 Present Nextstate state ab =00 01 10 1 Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 00 01 11 10 1 y 2 a b Y2 = ab + ay2 + by2

Deriving s Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 y2 y1 s 1

Deriving s Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 y2 y1 s 1

Deriving s Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 y2 y1 s 1 1 y 2 s

Deriving s Present Nextstate state ab =00 01 10 11 Output y Y s 00 2 1 y2 y1 s 1 1 y 2 s

Deriving s s = y1 Present Nextstate state ab =00 01 10 11 Output y Y s 2 1 Y s 00 y2 y1 s 1 1 y 2 s s = y1

for the Moore-type serial adder FSM State-assigned table for the Moore-type serial adder FSM Present Nextstate state ab =00 01 10 11 Output y 2 1 Y s 00 Y1 = a + b + y2 Y2 = ab + ay2 + by2 s = y1 [ Figure 6.46 from the textbook ]

Circuit for the Moore-type serial adder FSM Full adder a b D Q Carry-out Clock Reset s Y 2 1 Sum bit y Y1 = a + b + y2 (sum from FA) Y2 = ab + ay2 + by2 (carry from FA) s = y1 [ Figure 6.47 from the textbook ]

Questions?

THE END