59.304 Assignment 1

Due 27th August 1997
There will be a penalty for late submission.

This assignment is concerned with the design of a simple Arithmetic/Logic Unit (ALU). An ALU is an important part of a CPU where all data processing operations take place. It is a combinatorial logic device which performs a number of functions of its inputs.

Your ALU should operate on two 4 bit binary numbers A and B and generate a third 4 bit number S. The function of the ALU is determined by a three bit binary number F as shown below.

F Name Function which gives S
000 AND Logical AND of A and B
001 XOR Logical Exclusive OR of A and B
010 SUB Subtract B from A (Ignore Cin) 
011 RSB Subtract A from B (Ignore Cin) 
100 ADD Add A and B (Ignore Cin)
101 ADC Add A and B and Cin
110 SBC Subtract (B + Cin) from A
111 RSC Subtract (A + Cin)  from B 
Block Diagram of the ALU

A0 is the least significant bit of A and A3 is the most significant bit.
Your task is to design the logic required to construct the ALU using as few gates as possible.
You may use AND, OR, XOR, NAND, NOR and NOT gates.

For operations which do not use the carry input, it should be ignored. For operations which can not generate a carry (the first two), the carry output should be zero. If a carry occurs as a result of an addition or a borrow occurs as a result of a subtraction then Cout should be 1.

It is probably a good idea if the design is split into manageable sections and each section designed independently,

You must use the logic simulator to design your solution, on the H drive is the file alu.lgf which you must use.

Draw your design, test it and then connect the correct inputs and outputs to those labelled  a0,a1,a2,a3,b0,b1,b2,b3,b4,s0,s1,s2,s3,s4,f0,f1,f2,cin and cout.
You can use the "to" labels to make this easier.

It is important that you read the documentation for the simulator.

You will submit a single file containing your design.  Instructions on how to submit will be given later.  No paper submissions will be accepted.

M Johnson 1997