Skip to content

Implementation of a 16-bit RISC processor utilizing the Logisim simulator to model and verify a single-cycle datapath and control unit.

Notifications You must be signed in to change notification settings

ssaharhani/Single-Cycle-Processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Single-Cycle Processor Design

Implementation of a 16-bit RISC processor designed for the Computer Organization and Microprocessor (ENCS2380) course at Birzeit University. This project utilizes the Logisim simulator to model and verify a single-cycle datapath and control unit.


πŸ› οΈ Processor Specifications

  • Architecture: 16-bit RISC processor with 16-bit instructions.
  • Registers: Includes eight 16-bit registers (R0 to R7).
  • Hardwired Zero: R0 is connected to zero; reading it returns 0, and writing to it has no effect.
  • Memory: 16-bit addressable memory with separate Instruction and Data segments (Harvard Architecture).
  • PC Register: 16-bit register containing the current instruction address.

πŸ“‘ Instruction Set Architecture (ISA)

The processor supports four instruction formats:

Format Description Field Breakdown
R-type Register operations Opcode (5b), rs1 (3b), rs2 (3b), rd (3b), func (2b)
I-type Immediate operations Opcode (5b), rs1 (3b), rd (3b), Immediate (5b)
SB-type Branch operations Opcode (5b), rs1 (3b), rs2 (3b), Split Imm (5b)
J-type Jump operations Opcode (5b), Immediate (11b)

Supported ALU Operations

The 16-bit ALU handles the following sequence of operations:

  • Arithmetic: ADD, SUB.
  • Logical: AND, OR, XOR.
  • Shifts: SLL, SRL, SRA.
  • Comparison: SLT (Signed), SLTU (Unsigned).
  • Special: Support for LUI (Load Upper Immediate).

πŸš€ Key Features

  • Stack Management: Register R6 is dedicated as the stack pointer, with the stack segment growing backwards in data memory.
  • Control Flow: Supports PC-relative addressing for branches and jumps (J, JAL).
  • Subroutine Support: JAL and JALR instructions save the return address (PC + 1) in R7 or a specified Rd.
  • Memory Access: Displacement addressing is used for Load Word (LW) and Store Word (SW).

πŸ“‚ Project Structure & Phases

  1. Phase 1: Implementation of the Register File (2 read ports, 1 write port) and the ALU.
  2. Phase 2: Assembly of the Full Datapath including PC, Instruction Memory, and Data Memory.
  3. Phase 3: Design of Control Units (Main and PC control) and final system integration.

University: Birzeit University
Course: ENCS2380 - Project #1

About

Implementation of a 16-bit RISC processor utilizing the Logisim simulator to model and verify a single-cycle datapath and control unit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published