Sunteți pe pagina 1din 7

# 02-Oct-10

## ECE 352 Digital System Fundamentals

This Week
Fall 2010 ECE 352: Digital System Fu undamentals

## Read: 4.5, 9.3, CLAs Group A

Post-Demo #1 (Wednesday) Pre-Demo #2 ( (FRIDAY) )

Group B: Demo #1

W5 2

Topics
Fall 2010 ECE 352: Digital System Fu undamentals

Incrementing/decrementing Zero-fill Sign-extension Constant multiplication

## Arithmetic Logic Units

W5 3

02-Oct-10

Fall 2010

Easy to create
Good hierarchy Tileable structures

## Small hardware Slow!

Design is limited by the delays in propagating carry through all of the bitwise additions The output bit at position m is not valid until after the carry out of the m-1 position is ready

W5 4

Fall 2010 ECE 352: Digital System Fu undamentals

For big adders, the carry-chain is very long Separate the carry chain and sum logic Partial Full Adders
Contain only the sum part of a FA

CIN

W5 5

COUT

Fall 2010

## Can create ripple-carry adder with PFAs

G: Generates a carry at this position P: Propagates a carry through this position

W5 6

02-Oct-10

## Generate and Propagate

Fall 2010

Generate
Based on the operand values at just this bit position, will my carry-out for this position be 1 regardless of the value of my carry-in?

## ECE 352: Digital System Fu undamentals

Propagate P t
Based on the operand values at just this bit position, do I know that my carry-out for this position will be equal to my carry-in?

W5 7

Fall 2010

## As usual, can trade area/power for speed

Multi-level logic (ripple carry) reduces area Flattening carry logic increases speed

## ECE 352: Digital System Fu undamentals

Worksheet:
Write the two level expressions for C1, C2, and C3 in terms of C0 and the PFA G and P outputs

## Sometimes called CLA

W5 8

ECE 352: Digital System Fu undamentals Fall 2010

W5 9

02-Oct-10

Fall 2010

## Need to add group G and P outputs to CLA

Indicates if the g group p as a whole will generate g or propagate a carry

Use additional carry look ahead block to handle group carry signals Worksheet: Create a 16-bit CLA

W5 10

ECE 352: Digital System Fu undamentals Fall 2010

W5 11

## Key to Understanding CLAs

Fall 2010 ECE 352: Digital System Fu undamentals

Remember what the words generate and propagate mean for the carry bits Remember how to use hierarchy in a CLA Read the CLA document posted on Learn@UW its required
Most students find it easier to understand than the book description

W5 12

02-Oct-10

Topics
Fall 2010 ECE 352: Digital System Fu undamentals

Incrementing/decrementing Zero-fill Sign-extension Constant multiplication

W5 13

Fall 2010

W5 14

## ECE 352: Digital System Fu undamentals

Worksheet: Decrementer
Fall 2010 ECE 352: Digital System Fu undamentals

A B C C

A B C

A B

CIN S S

CIN S

CIN

W5 15

02-Oct-10

## Zero-Fill and Sign Extension

Fall 2010 ECE 352: Digital System Fu undamentals

## Sometimes need to represent a value using additional bits

For example, add 4-bit value to an 8-bit value

## If unsigned, need to zero-fill

Append 0s to most significant end of vector Example: 0101 becomes 00000101

## If signed, need to sign extend

Replicate MSb for additional upper bits Example: 0101 becomes 00000101 Example: 1100 becomes 11111100

W5 16

Multiplication/Division
Fall 2010 ECE 352: Digital System Fu undamentals

General multipliers/dividers more complicated than we deal with in this class Can multiply by constant by performing a series of adds Powers of 2 make multiply/divide easy
Just a shift by log2 of the multiplier/divisor Example: 010102 X 410 = 1010002 Example: 011102 / 210 = 001112

W5 17

Topics
Fall 2010 ECE 352: Digital System Fu undamentals

Incrementing/decrementing Zero-fill Sign-extension Constant multiplication

W5 18

02-Oct-10

Fall 2010

## Sometimes want one structure with multiple possible functions

Add, subtract, increment, bitwise AND, etc.

## ECE 352: Digital System Fu undamentals

Combining arithmetic and logic ALU N mode mode bits can specify up to 2N different modes for the structure
All logic computes on the operands, but use muxes to choose which logic produces output

In some cases, operations similar enough that they can share some or all logic
Use muxes to choose between inputs

W5 19

## Arithmetic Logic Unit

Fall 2010 ECE 352: Digital System Fu undamentals

Example: Build a 4-bit ALU with the mode signals and modes listed below Mode Signals F G 0 0 0 1 1 X

## O Operation ti A+B AB A& B

W5 20

Next Week
Fall 2010 ECE 352: Digital System Fu undamentals

Read: D Latch and FF, 5.4-5.5 Written HW #3 Due Th 10/7 Group A: Demo #2 Group B: Post #1, #1 Pre #2 Due W 10/6

Arithmetic Logic Units D Latches and FFs, FF Timing Intro to Sequential Circuits, Counters

W5 21