ALU - Constructing an ALU Ref: Chapter 4 CompOrg Fall 2000...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CompOrg Fall 2000 - Number Representation 1 Constructing an ALU Ref: Chapter 4 CompOrg Fall 2000 - Number Representation 2 Arithmetic Logic Unit • The device that performs the arithmetic operations and logic operations. – arithmetic ops: addition, subtraction – logic operations: AND, OR • For MIPS we need a 32 bit ALU – can add 32 bit numbers, etc. CompOrg Fall 2000 - Number Representation 3 Starting Small • We can start by designing a 1 bit ALU. • Put a bunch of them together to make larger ALUs. – building a larger unit from a 1 bit unit is simple for some operations, can be tricky for others. • Bottom-Up approach: – build small units of functionality and put them together to build larger units.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 CompOrg Fall 2000 - Number Representation 4 1 bit AND/OR machine • We want to design a single box that can compute either AND or OR. • We will use a control input to determine which operation is performed. – Name the control “ Op ”. • if Op==0 do an AND • if Op==1 do an OR CompOrg Fall 2000 - Number Representation 5 Truth Table For 1-bit AND/OR 1 1 1 1 1 0 1 1 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 0 1 0 0 0 0 0 0 Result B A Op A B Op Result Op =0: Result is A B Op =1: Result is A + B CompOrg Fall 2000 - Number Representation 6 Logic for 1-Bit AND/OR • We could derive SOP or POS and build the corresponding logic. • We could also just do this: – Feed both A and B to an OR gate. – Feed A and B to an AND gate. – Use a 2-input MUX to pick which one will be used. • Op is the selection input to the MUX.
Background image of page 2
3 CompOrg Fall 2000 - Number Representation 7 Logic Design for 1-Bit AND/OR Mux Result A B Op CompOrg Fall 2000 - Number Representation 8 Addition A painful reminder of the test • We need to build a 1 bit adder – compute binary addition of 2 bits. • We already know that the result is 2 bits. 1 0 0 0 O 0 0 1 1 1 0 1 1 1 0 0 0 0 O 1 B A A + B O 0 O 1 This is addition, not logical OR! CompOrg Fall 2000 - Number Representation 9 One Implementation A B O 0 A B A B O 1
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 CompOrg Fall 2000 - Number Representation 10 Binary addition and our adder What we really want is something that can be used to implement the binary addition algorithm. O 0 is the carry O 1 is the sum 01001 + 01101 10110 1 1 Carry CompOrg Fall 2000 - Number Representation 11 What about the second column? • We are adding 3 bits – new bit is the carry from the first column. – The output is still 2 bits, a
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

ALU - Constructing an ALU Ref: Chapter 4 CompOrg Fall 2000...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online