Presentation computer architechure (1)

26
SINGLE CYCLE PROCESSOR Verilog implementation

Transcript of Presentation computer architechure (1)

Page 1: Presentation computer architechure (1)

SINGLE CYCLE PROCESSOR

Verilog implementation

Page 2: Presentation computer architechure (1)

• This processor executes each instruction in one clock cycle only.

• Compatible operations:I Type:

Load word

Store word

R Type:

Add

And

Or

Subtract

SLT

J Type

Beq

Page 3: Presentation computer architechure (1)

Register

• It takes the data addresses from instruction memory in order to fetch the data which is already saved in it and/or write the data from the data memory in a certain address. then save it in memory .

• Data is read through 2 32bit output ports for further operation.

• The Data required to be loaded onto the register is fed through 32 bit input port.

Page 4: Presentation computer architechure (1)

Register code

Page 5: Presentation computer architechure (1)

PC

• A program counter that compute the address of the next instruction and pass it to the instruction memory which read that address and pass the corresponding data to the register.

• The address of the next instruction is calculated by incrementing the current by 4 since we deal with words (32 bit )instruction, while the memory is byte addressable.

Page 6: Presentation computer architechure (1)

PC code

Page 7: Presentation computer architechure (1)

Controller

• It force some values for every instruction to control ALU and make operations on data.

• It is divided into two modules: controller which detects R , I and J types and sends signals accordingly

ALU control which determines which R type instruction received

Page 8: Presentation computer architechure (1)

Controller code

Determines I type instructions Load word, Store word, Branch equal and Jump instructions and gives outputs

The R type is determined and gives ALUop as an output which is not 00 or 01

Outputs from Controller: RegDst, Jump, Branch, MemRead, MemToReg, MemWrite, ALUsrc, RegWrite and ALUop

Page 9: Presentation computer architechure (1)

Controller Truth Table

Page 10: Presentation computer architechure (1)

ALU Control

• Determines the R type instructions which are Add, Subtract, And, Or

Page 11: Presentation computer architechure (1)

ALU• ALU takes 2 input data from register and check the operation from ALU

control and then generate a result and send it to memory (LW/SW) or the register (R).

ALU control Function

000 AND

001 OR

010 ADD

110 SUBTRACT

111 Set on Less Than

Page 12: Presentation computer architechure (1)

ALU code

Page 13: Presentation computer architechure (1)

Memory

• Memory receives data address from ALU to save data in it then it waits for an input to write data or read data.

• If read it will write data on register.

Page 14: Presentation computer architechure (1)

Memory code

Page 15: Presentation computer architechure (1)

Generic modules

Mux 32bit

Mux 5 bit

Adder

Shift left by 2

Sign extension

And gate

Page 16: Presentation computer architechure (1)

Data top module

Page 17: Presentation computer architechure (1)

Main top module

Page 18: Presentation computer architechure (1)

Simulation screenshots

• add

Page 19: Presentation computer architechure (1)

• Subtract

Zero flag

Simulation screenshots (cont’d)

Page 20: Presentation computer architechure (1)

Simulation screenshots (cont’d)

• and

Page 21: Presentation computer architechure (1)

• Or

Simulation screenshots (cont’d)

Page 22: Presentation computer architechure (1)

• Slt true

Simulation screenshots (cont’d)

Page 23: Presentation computer architechure (1)

• Slt false

Simulation screenshots (cont’d)

Page 24: Presentation computer architechure (1)

RTL Schematic

Page 25: Presentation computer architechure (1)
Page 26: Presentation computer architechure (1)