Skip to content

Commit 8714557

Browse files
committed
better logisim documentation
1 parent 763caa0 commit 8714557

8 files changed

+60
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Fateful can be installed via [cargo](https://github.com/rust-lang/cargo), but cu
1010
cargo install --git https://github.com/commonkestrel/fateful
1111
```
1212

13+
There is also a Logisim Evolution circuit simulation,
14+
which is located in the [`logisim`](https://github.com/commonkestrel/fateful/tree/master/logisim) directory.
15+
1316
Running a program has two steps: assembly and emulation.
1417
To assemble a program, run the `assemble` or `asm` command:
1518
```bash

logisim/README.md

+57-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,60 @@ There is a Logisim circuit available for simulating the F8ful CPU.
44
It requires version 3.9.0 or later of Logisim Evolution.
55
If lines turn to error values you may be running an earlier version.
66

7-
![Image of the main circuit](../misc/logisim.jpg )
7+
The circuit is broken up into a few major subcircuits:
8+
* [main](#main-circuit)
9+
* [register_bank](#register-bank)
10+
* [memory_bank](#memory-bank)
11+
* [alu](#alu)
12+
* [control](#control)
13+
* [sreg](#status-register)
14+
* [ports](#ports)
15+
16+
You can run a program by first loading it into the 64Kb ROM located in the `control` subcircuit.
17+
After your program is loaded, simply reset the CPU by toggling the `RESET` button, then run the clock.
18+
19+
## Main Circuit
20+
21+
The main circuit connects all of the subcircuits through the bus (B),
22+
as well as supplying the reset (R) and clock (C) signals.
23+
24+
![Image of the main circuit](https://github.com/commonkestrel/fateful/raw/master/misc/logisim-main.jpg)
25+
26+
## Register Bank
27+
28+
The register bank contains the 8 general-purpose registers.
29+
It handles reading and writing to specific registers.
30+
31+
![Image of the register bank circuit](https://github.com/commonkestrel/fateful/raw/master/misc/logisim-register-bank.jpg)
32+
33+
## Memory Bank
34+
35+
The memory bank handles reading and writing to adresses in memory.
36+
In addition, it controls writing to ports for MMI/O.
37+
38+
![Image of the memory bank circuit](https://github.com/commonkestrel/fateful/raw/master/misc/logisim-memory-bank.jpg)
39+
40+
## Arithmetic Logic Unit
41+
42+
The Arithmetic Logic Unit (ALU) handles arithmetic and logic operations (woah),
43+
such as addition, bitwise operations, etc..
44+
It contains two internal registers, which are used for the operations.
45+
46+
![Image of the ALU circuit](https://github.com/commonkestrel/fateful/raw/master/misc/logisim-alu.jpg)
47+
48+
## Control
49+
50+
The control circuit controls the rest of the CPU.
51+
It contains a program counter that adresses the program file stored in ROM.
52+
It uses a series of 3 ROMs to map instructions to bits in the Control Word,
53+
which instructs the rest of the CPU what to do each clock cycle.
54+
55+
![Image of the control circuit](https://github.com/commonkestrel/fateful/raw/master/misc/logisim-control.jpg)
56+
57+
## Ports
58+
59+
The ports circuit simply acts as a sample MMI/O chip,
60+
behaving similarly to the GPIO pins on an ATMega or ATtiny microcontroller.
61+
62+
![Image of the ports circuit](https://github.com/commonkestrel/fateful/raw/master/misc/logisim-ports.jpg)
63+

misc/logisim-alu.jpg

149 KB
Loading

misc/logisim-control.jpg

135 KB
Loading
File renamed without changes.

misc/logisim-memory-bank.jpg

160 KB
Loading

misc/logisim-ports.jpg

39.1 KB
Loading

misc/logisim-register-bank.jpg

170 KB
Loading

0 commit comments

Comments
 (0)