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

Info icon This preview shows pages 1–6. 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.
Image of page 1

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

View Full Document Right 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.
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
Image of page 3

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

View Full Document Right 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 sum and a carry 01001 + 01101 10110 1 1 Carry CompOrg Fall 2000 - Number Representation 12 Revised Truth Table for Addition 1 1 1 0 1 0 0 0 Carry Out 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 1 0 1 1 0 0 0 0 0 0 Sum Carry In B A
Image of page 4
5 CompOrg Fall 2000 - Number Representation 13 Logic Design for new adder
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern