Giter Club home page Giter Club logo

lc3-processor's Introduction

LC3-Processor

Split into 4 components

  • Main
  • Control Unit
  • ALU
  • Register File

Circuit's Purpose

The processor is run by a clock that causes every state to change in the whole processor. The Control Unit increments the instruction register counts through the processes and counts the number of steps. The ALU is a combinational circuit that primarily has 3 LC-3 operations: ADD, AND, and NOT. It calculates all three of these operations given a certain input. It uses a multiplexer to pick the correct output based on the instruction specified. The Register File section of the circuit stores the value output of the main given the instruction specified. I also implemented more LC-3 instructions such as JMP, LD/LDR, and ST/STR, but ran into a problem with JMP instruction not properly working which I will explain later.

Test code in Assembly

ADD R2, R2 #6
ADD R1, R1, #6
AND R3, R2, R1
AND R1, R1, #0
ADD R4, R3, R2
NOT R1, R1
JMP R4
.FILL x0000
.FILL x0000
.FILL x0000
.FILL x0000
.FILL x0000
ST R4, x0015
STR R2, R2, #15
LD R5, x0015
LDR R6, R3, #15

Code in hex tested for inputs to the RAM

14a6 1266 5681 
5260 18c2 927f 
c100 0000 0000 
0000 0000 0000 
3808 748f 2a06 
6ccf

Unusual Behavior

Code is good for most instructions such as ADD, AND, NOT, ST/STR, and LD/LDR because they result in the correct output of the instruction when you input the code in hex into the RAM; however, for JMP instructions, the code does not work for some reason as it just keeps looping. It should jump to the next specific address instead of looping. The JMP instructions could be fixed by changing some stuff in the Main circuit and some changes in the Control Unit given more time.

Technologies Used

  • Logisim
  • Assembly

lc3-processor's People

Contributors

lawrenceli7 avatar

Watchers

 avatar

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.