Git Product home page Git Product logo

a-simple-8-bit-processor's Introduction

A-Simple-8-Bit-Processor

The objective of this project is to design a simple microprocessor with a custom instruction set. The processor should consist of the following four main components:

  • A register file
  • An Arithmetic and Logic Unit (ALU)
  • A Read-Only Instruction Memory (IMEM)
  • A Read/Write Data Memory (DMEM)

Instruction Set and Format

Your processor should implement the following basic instruction set:

Instruction Opcode/Function Operation
add rd, ra, rb 0000 / 000 rd = ra + rb
sub rd, ra, rb 0000 / 010 rd = ra - rb
and rd, ra, rb 0000 / 100 rd = ra AND rb
or rd, ra, rb 0000 / 101 rd = ra OR rb
addi rd, ra, imm 0100 rd = ra + imm
lw rd, imm(ra) 1011 rd = DMEM[ra + imm]
sw rd, imm(ra) 1111 DMEM[ra + imm] = rd
beq rd, ra, imm 1000 If(ra == rd) pc = pc + imm
j addr 0010 pc = pc + addr

The program code is stored as 16-bit instructions in the IMEM. The processor implements three types of instruction:

Type 15-12 11-9 8-6 5-3 2-0
R (Register) Opcode Rd Ra Rb Func
I (Immediate) Opcode Rd Ra Imm[5:0]
J (Jumpp) Opcode Don’t care Addr[7-0]

Data Path Components:

  • Program Counter: One 8-bit register
  • Register File: Holds 8-bit 8 register
  • Instruction Memory: 8-bit address input, and outputs 16-bit
  • Data Memory: 8-bit read/write memory
  • ALU: Performs arithmetic and logical operations

Control Unit: Generates necessary signals to the data-path. Check single-cycle ARM processor design in the lecture slides to design the signals and implement the control unit.

Hint: The signals can be defined as MemToReg, MemWrite, RegWrite, ALUSrc, Branch, Jump

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.