1 / 3

A four function ALU

00 01 10 11. MUX. A. A. A. A. ADD. SUB. OR. AND. B. B. B. B. Result. Select 2 bits. A four function ALU. An arithmetic logic unit computes arithmetic or logic function We designed a two function arithmetic unit to perform ADD/SUB

betty_james
Télécharger la présentation

A four function 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. 00 01 10 11 MUX A A A A ADD SUB OR AND B B B B Result Select 2 bits A four function ALU • An arithmetic logic unit computes arithmetic or logic function • We designed a two function arithmetic unit to perform ADD/SUB • We can add two logical function to it, AND and OR • A four function ALU will have two bits to specify function • 00 (Add), 01 (Sub), 10 (AND), 11 (OR) • Then the following set up will work

  2. 0 1 Add/sub MUX A A A OR AND ADD/SUB B B B 0 1 MUX Result Select0 Select1 An alternate design of four function ALU • The previous design is not very efficient as it uses an adder and subtract circuit • We can design an add/subtract unit as discussed earlier • Then we can design a logical unit (AND and OR) separately • Then select appropriate output as result • What are the control signals, Add/Sub, Select0, and Select1?

  3. Operation codes • In micro-controllers, ALU units have many function • 16 arithmetic, 16 logic functions are common • A 5 bit code decides what function is required • This is part of an operation code in an instruction • Selection of operands is also specified as part of instruction • In actual instruction execution, operands A and B are first selected from different registers • Then different functions are computed • Finally, a result based on operation code is selected • This sequence is repeated for every instruction

More Related