Computer Science, asked by metaasik, 2 months ago

⦁ Please build a 1-bit ALU (in form of a picture) using some logic gates, such AND gate and OR gate, to realize the basic arithmetic (AND, OR, Addition and Subtraction) and logic (NOR and NAND) operations;

Answers

Answered by robinghost731
1

Answer:

The goal of this tutorial is to understand the basics of building complex circuit from simple AND, OR, NOT and XOR logical gates. (We have studied in class the functionalities of the corresponding bitwise operators.) This tutorial will teach you how to build an Arithmetic Logic Unit (ALU) from scratch, using these simple logic gates and other components. Read each tutorial step carefully and complete the activities listed in each step.

The ALU will take in two 32-bit values, and 2 control lines. Depending on the value of the control lines, the output will be the addition, subtraction, bitwise AND or bitwise OR of the inputs. Schematically, here is what we want to build:

Figs/aluiface.gif

Note! This is an interface for the ALU: what goes in, what comes out. It also shows the ALU as an abstraction: you can't see how it works, but you do know what it does.

Also note that there are three status outputs as well as the main result: is the result zero, was there a carry, and did the operation result in an overflow?

Note: just a reminder on the difference between a carry and an overflow:

Carry: was there a carry in the most-significant bit which we could not output in the given number of bits (32 bits, above)?

Overflow: does the sign of the output differ from the inputs, indicating (for example) that a sum of two positive numbers has overflowed and is now a negative result?

Some of the data and control lines are shown with a slash and a number like 32.

Figs/buswidth.gif

This indicates that the line is actually 32 lines in parallel, e.g. the result is 32-bits wide. If you don't see a slash in the diagrams below, you can assume that the line is only 1-bit wide.

Similar questions