Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions blog/images/mips-asm-2/D-flip-flop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions blog/images/mips-asm-2/and.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions blog/images/mips-asm-2/set-reset-latch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions blog/posts/mips-asm-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
date: 11 Nov, 2023
tags: MIPS, processor
category: CS
---

# Building a MIPS Processor from Scratch

Chapter 4 of *Computer Organization and Design* explains how a computer can be build from scratch,
using logic gates. Let's take a look.

## Combinational and State Elements

There are two types of elements we use when designing a classical computer, combinational and state.
Combinational elements operate on data, while state elements, as the name suggests, contain state.

For example, a simple AND gate is a combinational element:

![AND gate](../images/mips-asm-2/and.svg)

While a set-reset latch is a state element:

![set-reset latch](../images/mips-asm-2/set-reset-latch.svg)

For a set-reset latch, when we assert the set signal (S) and deassert the reset signal (R), Q is asserted
and vice versa. A more complex version that incorporates the clock signal is the D flip-flop:

![D flip-flop](../images/mips-asm-2/D-flip-flop.svg)

With combinational and state elements, we can build a finite state machine, which is basically what computers
are.

## Pipelining