Академический Документы
Профессиональный Документы
Культура Документы
ABSTRACT
MIPS is a RISC instruction set architecture which has gained popularity over
many year and has found many uses in various embedded systems. This paper
describes how to implement the instruction execution unit of a single cycle 8-bit RISC
architecture having a custom instruction set which is based on 32 bit microMIPS
architecture, a type of MIPS architecture and also explains the functioning and
execution of each type of instruction supported. The paper also describes various
functional units in the 8 bit custom architecture. The custom instruction set includes 9
instructions and implementation of the proposed architecture is done using Verilog on
Field Programmable Gate Array (FPGA) Altera Cyclone II. A different approach for
the implementation of these execution units for a subset of instructions is presented in
detail.
Key word: MIPS, RISC, microMIPS, FPGA.
Cite this Article: Mohit Rane, Arjav Naik and Kalpan Mehta, 8 Bit Custom MIPS
Microprocessor. International Journal of Computer Engineering & Technology, 8(5),
2017, pp. 23–30.
http://www.iaeme.com/ijcet/issues.asp?JType=IJCET&VType=8&IType=5
1. INTRODUCTION
The microMIPS architecture has many functional units and each of them plays a unique role
in processing an instruction. The conventional architecture has standardized execution units
for the instructions supported by it. The 8-bit microprocessor is based on load store
architecture and supports register, immediate and jump type of instruction. As it is a 8 bit
architecture there are 8 registers each of 8 bits r0 to r7, the data bus is of 8 bits, the data
memory has 256 addresses each can store data of 8 bits and the instruction memory can have
256 instructions and instructions length is 16 bit wide [1]. Various changes are made to the
conventional design to make an architecture which will be capable of supporting 9
instructions. The implementation is done in Verilog and it is realized on Altera Cyclone II.
The flow of the paper starts with an insight in conventional microMIPS architecture
followed by custom RISC architecture. The microprocessor elements, its instruction format
and instruction set is explained. After which the methodology and dataflow explains the
functioning of the custom architecture. Analysis of microprocessor is done and conclusion is
drawn.
http://www.iaeme.com/IJCET/index.asp 23 editor@iaeme.com
Mohit Rane, Arjav Naik and Kalpan Mehta
The function of next address box is to compute the next instruction’s address depending
upon the instruction type whether it is a conditional jump or a un-condition jump.
http://www.iaeme.com/IJCET/index.asp 24 editor@iaeme.com
8 Bit Custom MIPS Microprocessor
instruction, then a signal from the control unit is sent to the PC and the further procedure is
taken place in the PC.
4. MICROPROCESSOR ELEMENTS
The various microprocessor elements that are required for the working of the custom
microMIPS instruction execution unit are as follows:
4.3. Decoder
The main function of decoder is to decode the instruction that is provided to it by the
instruction memory. It detects whether the instruction is of R, I or J type depending upon the
opcode it get from the instruction. And according to the instruction type various fields will be
sent further to the respective blocks for further process. Sign extension will also be done in
this block for I type of instruction’s immediate value. Opcode and function will go to Control
Unit.
http://www.iaeme.com/IJCET/index.asp 25 editor@iaeme.com
Mohit Rane, Arjav Naik and Kalpan Mehta
http://www.iaeme.com/IJCET/index.asp 26 editor@iaeme.com
8 Bit Custom MIPS Microprocessor
4.8. ALU
ALU is stands for arithmetic logical unit and it performs 5 functions:
Addition (R and I type)
Subtraction (R type)
Bitwise AND (R type)
Bitwise OR (R type)
Compare (I type)
It will perform one of this five functions according to the input control signal which it
gets from the control unit. The opcode , function and ALU control signal for the supported 9
instructions by the custom architecture is shown in Table 2.
4.11. Display
This block does not have any use in the actual processing of instruction. The main function of
this block is to display the final output of R or I or J type instruction. It will take the final
value of the processed instruction and use it for display purposes.
http://www.iaeme.com/IJCET/index.asp 27 editor@iaeme.com
Mohit Rane, Arjav Naik and Kalpan Mehta
R type Op Fn Unused Rd Ra Rb
instruction 3 bits 2 bits 2 bits 3 bits 3 bits 3 bits
15-13 12-11 10-9 8-6 5-3 2-0
I type Op Immediate Ra Rb
instruction 3 bits 7 bits 3 bits 3 bits
15-13 12-6 5-3 2-0
6. INSTRUCTION SET
The operations performed by the 9 instructions supported by the custom 8 bit microprocessor
are in Table 3 [6].
7. METHODOLOGY
Each of the block shown in the Figure 2 is implemented as a separate module with suitable
input and output port definitions and they are instantiated to make the dataflow in Verilog [7].
Each block will be triggered by a positive edge of clock for synchronization. A mix of
behavioral modeling and data flow modeling in Verilog was used to develop the circuit
components.
8. DATAFLOW
Address bus will be of 8 bits and data bus will be also of 8 bits. The execution of the R, I, J
instruction is described below.
8.1. R type
R type of instruction will be fetched and forwarded to decoder.
http://www.iaeme.com/IJCET/index.asp 28 editor@iaeme.com
8 Bit Custom MIPS Microprocessor
The decoder comes to know that the instruction is of R type from 3 bit opcode.
Decoder will provide opcode and function to control unit and control unit will then generate
appropriate control signals.
Register Destination will let rd or rb to be the final destination of R type instruction.
Alu Source will let the value of register indicated by rb to be forwarded to ALU.
ALU performs the appropriate operation on the two data coming from the register (ra) and
register destination (rb).
The calculated output produced by ALU will be forwarded to the MemtoReg mux.
This output will then be finally stored in the register destination (rd).
The data present in the register destination is forwarded to the Display block to show the
value.
8.2. I type
I type of instruction will be fetched and forwarded to decoder. The decoder comes to know
that the instruction is of I type from 3 bit opcode.
Decoder will provide opcode to control unit and control unit will then generate appropriate
control signals.
Register Destination will let rb to be the final destination of R type instruction.
Alu Source will let the immediate value of register to be forwarded to ALU.
ALU performs the appropriate operation on the two data coming from the register (ra) and
register destination (rb). For beq instruction, comparison is done. If comparison is satisfied
then branch will occur in the next instruction and PC value will be updated. For addi, lw and
sw, it will add the immediate and value from ra register.
Data Memory will only be used in lw and sw type of instruction. This will be the last stage for
sw instruction as it will only store the value provided by the rb register to the location
indicated from ALU output.
The calculated output produced by ALU will be forwarded to the MemtoReg mux. Also the
output of Data Memory will be forwarded to this mux.
MemtoReg mux will decide which input needs to be forwarded further. In case of lw type, it
will select input from Data Memory. In case of addi type, it will select input from ALU. This
mux will not be used for sw and beq type of immediate instructions.
This output will then be finally stored in the register destination (rb) (if instruction is lw or
addi).
The data present in the register destination is forwarded to the Display block to show the
value for lw and addi instruction. For sw instruction, data stored in data memory is forwarded
and for beq, the final PC value is forwarded.
8.3. J type
The decoder comes to know that the instruction is of J type from 3 bit opcode.
Decoder will provide opcode to control unit and control unit will then generate appropriate
control signal i.e. NIA indicating that it is an un-conditional Jump.
Decoder will send this 8 bit immediate value to the PC, and in next instruction PC will jump
to that address.
http://www.iaeme.com/IJCET/index.asp 29 editor@iaeme.com
Mohit Rane, Arjav Naik and Kalpan Mehta
10. CONCLUSIONS
The custom architecture implemented was successful in executing all the 9 instructions. The
design was verified by loading the instruction memory with instructions and the results were
observed on the Altera Cyclone II FPGA kit with the help of display function element. The
design is verified through exhaustive simulations. Very less amount of resources were
utilized in implementation of the architecture. The conventional microMIPS architecture
supports many instructions but also uses many resources. This custom architecture provides
better management of logical units for execution of a limited set of instructions.
REFERENCES
[1] Behrooz Parhami, Computer Architecture, From Microprocessors to Supercomputers,
Oxford University Press.
[2] David A. Patterson, John L. Hennessy, Computer Organization and Design MIPS Edition.
[3] John Hennessy, Norman Jouppi, Forest Baskett, John Gill, MIPS: A VLSI Processor
Architecture, Springer.
[4] Dr. Chandra Shekhar, A Report on Design of 16 – bit RISC Processor.
[5] Microprocessor Design, CSIT Laboratory.
[6] MIPS Green Sheet, EECS Instructional and Electronics Support, University of California,
Berkeley.
[7] Samir Palnitkar, Verilog HDL: A guide to Digital Design and Synthesis.
[8] M. Morris Mano, Digital Design, EBSCO Publishing Inc.
[9] Qazi Raza Abdul Quadir, Arif Rasool, Manan Mushtaq, YasirBhat, Design And
Simulation of a Non-Pipelined, Multi- Cycle 16 Bit Risc Educational Processor Using
Verilog HDL. International Journal of Electronics and Communication Engineering &
Technology (IJECET), 5(9), 2014, p p. 14–23.
[10] Vijay Kumar Jinde, Nagaraju Boya, Swapna Chinthakunta, Ramanjappa Thogata, Design
And Implementation of Low Power Pipelined 64 -Bit Risc Processor Using FPGA,
International Journal of Advanced Research in Engineering and Technology (IJARET),
5(2), 2014, p p. 61–69.
http://www.iaeme.com/IJCET/index.asp 30 editor@iaeme.com