Coder Social home page Coder Social logo

comparch_hw1's Introduction

CompArch_HW1

Authors: Zhengqi Xi and Arnold Wey

A simple 2 bit intruction set with 3 instructions: JNP, HALT, and INC. Since this is our first time working with Verilog, the code is quite messy, and definietly can be done cleaner. Also, a C++ file included that takes an input file and compiles it to instructions (doThis.why) to be fed into the Verilog simulator.

Note: In the documentation, unless explicitly stated otherwise, modules that contain clk, clk_en, and reset (anything including ff.v) all take the external input clk to the internal input .clk. The only exception is in registerCounter, where .clk_en is connected to the INC state.

Note: Anything with the format *_tb is a test file for the module. Also, a makefile is not included with this program, since people use different compilers for verilog anyway. It's probably pointless.

Note: JNP is the name we gave to the STATE of the machine, not J ump if N ot O verflow. See transition.jpg in Documentation

Table of Contents

Documentation Planning

Contains logic diagrams of components designed at gate level, as well and Funtional Block Diagrams and a hierarchy of `includes.

Testbenches

Contains testbench code for each component

paperProcessor_TB.v

Runs a testBench of the paperProcessor.v

paperProcessor.v

"Glues" the processor together. Comprised of:

demux.v (decoder)
processorCore.v (pCore)
registerCounter.v (rCounter)
programCounter.v (pCounter)
memory.v (r_mem)

as well as data[1:0] and address[1:0] lines.

processorCore.v (pCore)

Takes a two bit instruction and outputs a 2 bit state. That state is decoded, and determines the next action of the paper processor.

External Input: data[1:0]
Internal Input: i1, i0
Output: c1,c0

demux.v (decoder)

Acts as a decoder for the 2 bit output state from processorCore.v (pCore) and activates or deactivates specific parts of the circuit.

ex: INC goes to the clk_en of rCounter, which is clocked every time but isn't enabled unless the state of the paper processor is INC.

External Input: c1,c0 
Internal Input: c1, c0
Output: INC, JNP, HALT, START

registerCounter.v (rCounter)

3 bit UpCounter clocked each time, but not enabled unless the machine is in INC mode. eg: See above.

External Input: INC
Internal Input: clk_en
Output: r2

programCounter.v (pCounter)

Changes address of memory being read based on the current state of the machine (INC, JNO, etc)

External Input: JNP, INC, r2, data[1:0]
Internal Input: JNP, INC, r2, i1, i0
Output: p1,p0 (--> address [1:0])

memory.v (r_mem)

Reads a binary file and puts it into a 4 by 2 matrix, bit addressable.

External Input: address[1:0] 
Internal Input: address[1:0]
Output: data[1:0]

comparch_hw1's People

Contributors

currentlyawey avatar zhengqixi avatar

Watchers

James Cloos avatar  avatar  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.