- Assignment #01:
(2 Tasks, with 4-5 parts each)
- Assignment #02:
(8 Exercises)
- IDE: Intellij IDEA
- Extensions:
openjdk-16-jdk
sbt-1.10.2
- Scala files use the
.scala
extension.
Functional Scala emphasizes immutability and the use of functions as first-class objects. The main focus is on declarative programming, where you describe what your program should do, rather than how to do it, relying heavily on recursion and higher-order functions. Here's a quick breakdown:
- Immutability: Variables, once initialized, cannot be altered, preventing unintended side effects.
- Pure Functions: Functions that return the same output given the same input and have no side effects.
- Higher-Order Functions: Functions that take other functions as parameters or return them.
- Pattern Matching: A powerful feature that simplifies control flow by matching data structures directly.
- Program Counter: Tracks the current instruction address and increments by 4 (or jumps for branch/jump instructions).
- Instruction Memory: Stores the set of instructions that the processor executes in binary form.
- Control Decoder: Reads the opcode from the instruction and generates the necessary control signals (ALUOp, MemRead, MemWrite, etc.).
- Register File: Stores temporary data in registers (
x0
throughx31
). The write-back stage writes results back here. - ALU: Performs all arithmetic and logical operations, such as addition, subtraction, AND, OR, and compares.
- Data Memory: Contains memory for data that is read from or written to, based on the instruction (e.g.,
lw
,sw
). - Data Memory Interface: Ensures correct communication between the ALU and memory for loading/storing operations.
- Write Back: Handles writing the results of computations back to the register file.
- Software:
logisim-win-2.7.1
- Extensions:
jre-8u421-windows-x64
- Logisim files use the
.circuits
extension.
Here's a visual representation of the Single Cycle Processor implemented in Logisim: