1 / 15

Designing an ALU

Designing an ALU. Taken from various sources Primary source: Digital Design and Computer Architecture by Harris &Harris. ALU. An arithmetic logic unit ( ALU ) Performs arithmetic and logic operations A fundamental building block of the Central Processing Unit (CPU) of a computer

eyad
Download Presentation

Designing an ALU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Designing an ALU Taken from various sources Primary source: Digital Design and Computer Architecture by Harris &Harris

  2. ALU • An arithmetic logic unit (ALU) • Performs arithmetic and logic operations • A fundamental building block of the Central Processing Unit (CPU) of a computer • Even the simplest microprocessors contain one for purposes such as maintaining timers • A combinational logic circuit

  3. Complex ALU

  4. Simple ALU The S input is controlled by the processor based on the op code

  5. Adder full adder from a previous lecture

  6. Adder/Subtractor

  7. Textbook ALU

  8. Our Target ALU, N=32 The F input is controlled by the processor based on the op code

  9. Possible Implementation module alu (input [31:0] A, B, input [2:0] F, output reg [31:0] Y); // implement everything using a case statement??? always @ (*) case (..) … endcase endmodule

  10. An Implementation From Harris Text: a simple ALU A cover a cover a cover a cover a cover a cover a cover a cover

  11. Test Cases

  12. Test the Implementation A simple testbench A cover a cover a cover a cover a cover a cover a cover a cover

  13. ALU Enhancements • Add a Zero output to the ALU. The output is TRUE when Y==0, otherwise it is FALSE. • Add and Overflow output to the ALU. The output is TRUE when the result of the adder overflows, otherwise it is FALSE.

  14. An Implementation From Harris Text: an enhanced ALU A cover a cover a cover a cover a cover a cover a cover a cover

  15. A Better Testbench • Improved Testbench • Data file

More Related