CSE306 Asssignment 3- bit MIPS Design and Simulation Solved

30.00 $

Category:

Description

Rate this product

bit MIPS Design and Simulation

In this assignment, you have to design an 8-bit processor that implements the MIPS instruc- tion set. Each instruction will take 1 clock cycle to be executed. The length of the clock cycle will be long enough to execute the longest instruction in the MIPS instruction set. The main components of the processor are as follows: instruction memory, data memory, register file, ALU, and a control unit. Additional components such as multiplexors, adders etc can added as required by your design.

1 DESIGN SPECIFICATION

  • Addressbusanddatabusaremultiplexed.
  • Eachofdataandaddresshasasizeof8-bits.
  • An8-bitALUwillberequired,hencethename8-bitMIPS.
  • Theregisterfilemustincludethefollowingtemporaryregisters:

    $zero, $t0, $t1, $t2, $t3, $t4

    Each register has a size of 8-bits. The assembly code that will be provided to simulate your design will use only the above mentioned registers.

  • The control unit should be micro-programmed. The control signals associated with the operations should be stored in a special memory (you can use a separate ROM for this purpose) units as Control Words.
  • All clocks required in the circuit must be provided from a single clock source. Each in- struction should be fetched and executed in a single clock cycle.

1

• Your design will be evaluated based on accuracy (correct flow of execution for each implemented instruction), completeness (all assigned instructions have been imple- mented), and efficiency (minimizing the number of ICs used, automated assembler).

2 INSTRUCTION SET DESCRIPTION

Instruction ID

A B C D E F G H

Category

Arithmetic Arithmetic Arithmetic Arithmetic Logic

Type

Instruction

R add I addi R sub I subi

R and Logic I andi

Logic R or Logic I ori

I Logic J Logic

R sll R srl R nor I sw I lw

I beq I bneq Jj

K L M N O P

Logic Memory Memory Control-conditional Control-conditional Control-unconditional

3 MIPS INSTRUCTION FORMAT
Our MIPS Instructions will be 20-bits long with the following three formats.

  • R-type
  • I-type
  • J-type

Opcode 4-bits

Opcode 4-bits

Opcode 4-bits

Src Reg 1 4-bits

Src Reg 4-bits

Src Reg 2 4-bits

Dst Reg 4-bits

Dst Reg Shft Amnt 4-bits 4-bits

Address / Immediate 8-bits

0 0 4-bits 4-bits

Target Jump Address 8-bits

4 MEMORY CONSIDERATIONS

For a single cycle implementation of MIPS instruction set, you need to have two separate mem- ory units for instruction and data.

  • InstructionMemoryisaccessedthroughan8-bitaddresswhichisstoredinan8-bitPro- gram Counter (PC) register. Each access to the instruction memory provides 20-bit (in- struction) data.
  • DataMemoryisalsoaccessedthroughan8-bitaddress.

2

Group ID

1 2 3 4 5 6

5 INSTRUCTION SET ASSIGNMENT

The opcodes of the instruction will be between 0 to 15 based on the sequence of instruction id given below. Sequence ABCDEFGHIJKLMNOP means add instruction’s opcode will be 0, addi instruction’s opcode will be 1, sub instruction’s opcode will be 2, and so on.

Section A1 Section A2 Section B1 Section B2

FBKOINHDACFGELMP GHCIAFEBFKDPLNOM IEMFPDFNKLCHGBAO PLIADGFBKFNCEMOH HCAGNMIFDBOFEPKL GAPOLNDMFKHCFEIB KAGBLIPFNFMDCHEO AKEHPDFOBCNLGMFI HOCIKFEBAFNLDGMP FDNKLIMFEOPBGCHA IONHAKEBDLMFPCFG GBFOLNAIEDFMKHCP IOECDBPNKMGHFFLA HFABDNKMPOLIECFG AHLOGBFNMFDPECKI HBDMNEKCPLAIGFFO LNKIFHPBECOGFMAD KILHFDPNBMFGEACO EFNPOCDBIGAHMFKL PAGIFOEHFNMDCLKB POFMBNDECAGIHKLF FLHGNIKAFBCMPEDO MICHBDFLOAGFKPNE CLIFMHOEBKFGDNAP

6 EXTRA FEATURES

You have to implement push and pop operations in your MIPS design using a Stack. To achieve this task, the stack memory will be shared with the data memory in the following way. The data memory should start from the minimum address (0x00) and grow to the increasing memory addresses. On the contrary, the stack memory should start from the maximum address (0xF F ) and grow to the decreasing memory addresses. The top of your stack will be held by a stack pointer ($sp). Initially $sp will hold an address of 0xFF (highest address of the stack memory). The push and pop operations will be used in the provided assembly code according to the following table and you have to implement them using your MIPS instruction set.

Instruction

push $t0 push 3($t0) pop $t0

Description
mem[$sp] = $t0 mem[$sp] = mem[$t0+3] $t0 = mem[$sp]

7 SIMULATION

To simulate your design, an assembly code will be used. Before starting the simulation, you have to convert the given assembly code into MIPS machine code and load the machine code into the instruction memory. The conversion process must be automatic. For example, you can write code in your preferred programming language for this conversion.

8 REPORT CONTENT

Contents of the report are recommended as follows:

  • Section 1: Introduction
  • Section2:InstructionSet
  • Section3:CompleteBlockdiagramofan8-bitMIPSprocessor.Theblockdiagrammust follows necessary descriptions.
  • Section4:Blockdiagramsofthemaincomponents.

3

– InstructionmemorywithPC – Registerfile
– DatamemorywiththeStack – Controlunit

  • Section5:Approachtoimplementthepushandpopinstructions
  • Section6:ICsusedwiththeircount
  • Section 7: Discussion
  •  

4

  • Assignment-03-MIPS-zr8kwb.zip