CSE 140L Hardware Lab Four


Objectives

We will learn how to design and build simple mini-CPU




Design an CPU for which must satisfy the following requirements:

  • 5-bit addition.
  • Multiply by 2 and divide by 2 (shift left/right operation).
  • It must have 2 5-bit registers that hold values for the calculator.
  • It takes in a 8-bit value as input (3-bit instruction set & 5-bit data).
  • It gives out a 5-bit value as result of the calculations.
  • Each instruction will happen during one clock cycle.

Detail Requirements:

  • 000 XXXXX - clear the two registers (output 0000).
  • 001 XXXXX - put XXXXX value into register 1.
  • 010 XXXXX - put XXXXX value into register 2.
  • 011 XXXXX - take previous result & store into register 2.
  • 100 XXXXX - add register 1 & register 2 values (output result).
  • 101 XXXXX - multiply register 2 value by 2 (output result).
  • 110 XXXXX - divide register 2 value by 2 (output result).
  • 111 XXXXX - masking (ANDing) register 1 and register 2.

Note: You are required to use bus for this lab. For Simulation, do the following steps:

  • Clear the two registers
  • Put some value into regsiter 1
  • Put some value into register 2
  • Add the 2 numbers together
  • Take the previous result and put into register 2
  • Multiply register 2 by 2
  • Divide register 2 by 2
  • (DO THIS THREE TIMES WITH DIFFERENT VALUES EACH TIME)

 


Grading: Show your circuit design & demonstrate your simulation result to the TA or professor at office hours during week 10.