User Tools

Site Tools


2014:8-bit_minecraft_cpu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
2014:8-bit_minecraft_cpu [2014/12/17 03:35]
siddthesquid
2014:8-bit_minecraft_cpu [2014/12/19 11:47] (current)
siddthesquid [Future Work]
Line 4: Line 4:
  
 Our goals for this project are to: Our goals for this project are to:
-  * Design an 8-bit computer architecture with a 512 total bytes of memory (256 bytes of instruction memory + 256 bytes of data memory) and 8 total one-byte registers (4 architecture specific registers and 4 general registers).+  * Design an 8-bit computer architecture with a 192 total bytes of memory (128 bytes of instruction memory + 64 bytes of data memory) and 8 total one-byte registers (4 architecture specific registers and 4 general registers).
   * Implement our 8-bit CPU into a Minecraft world using a RedPower modpack which contains basic electrical components (such as logic gates, flip flops and latches, clocks, and multiplexers)   * Implement our 8-bit CPU into a Minecraft world using a RedPower modpack which contains basic electrical components (such as logic gates, flip flops and latches, clocks, and multiplexers)
   * Execute programs through our CPU by loading the instruction memory and checking the outputs of the registers or data memory   * Execute programs through our CPU by loading the instruction memory and checking the outputs of the registers or data memory
Line 27: Line 27:
   * 8-bit CPU. This means that each of our registers, memory space, and instructions will be 8 bits long.   * 8-bit CPU. This means that each of our registers, memory space, and instructions will be 8 bits long.
   * Single-cycle CPU. Each instruction takes exactly one cycle to be completed.   * Single-cycle CPU. Each instruction takes exactly one cycle to be completed.
-  * 256-byte data memory +  * 64-byte data memory 
-  * 256-byte instruction memory+  * 128-byte instruction memory
   * 8 registers (each are 1 byte big)   * 8 registers (each are 1 byte big)
   * 1 byte Program Counter   * 1 byte Program Counter
Line 45: Line 45:
 Purpose: [Jump Pointer] Whenever we need to jump to or branch to a specific point in the data memory, the program counter will change to the value located in $JP. Purpose: [Jump Pointer] Whenever we need to jump to or branch to a specific point in the data memory, the program counter will change to the value located in $JP.
 ---- ----
-Register:​Z\\+Register: ​$Z\\
 Purpose:​[Zero] This register is always set to 0. Purpose:​[Zero] This register is always set to 0.
 ---- ----
Line 64: Line 64:
  
 Our CPU will be able to execute the following instructions. If you want to make a program, the following section will serve as the documentation required to create the program. ​ Our CPU will be able to execute the following instructions. If you want to make a program, the following section will serve as the documentation required to create the program. ​
---- 
-Instruction:​ TW\\ 
-Format: | 000aaaxs |\\ 
-Description:​ [Transfer Word] If s = 0, store a byte from the register file to the data memory. The value in register $a will be stored to the address in the data memory indicated by $DMP. If s=1, load a byte from the data memory to the register file. The value stored in the address in the data memory indicated by $DMP will be stored to register $a. 
 ---- ----
-Instruction: ​MOV\\+Instruction: ​MOVA\\
 Format: | 000aaabb |\\ Format: | 000aaabb |\\
-Description:​ [MOVe values] Move the value from register $b to $a. $a=$b. Notice that only 2 bits have been allocated for the $b register, even though there are 8 registers. $b registers may only select general registers. (00 selects $G0, 11 selects $G3)+Description:​ [MOVe values ​(extra A)] Move the value from register $b to $a. $a=$b. Notice that only 2 bits have been allocated for the $b register, even though there are 8 registers. $b registers may only select general registers. (00 selects $G0, 11 selects $G3)
 ---- ----
-Instruction: ​LI\\ +Instruction: ​MOVB\\ 
-Format: | 000iiiis ​|\\ +Format: | 001aabbb ​|\\ 
-Description:​ [Load ImmediateLoad an immediate ​value into the accumulatorif s=0, then the least 4 significant bits of $ACC=iIf s=1, then the most 4 significant bits of $ACC=iIn order to change all values of $ACCthis function must be called twice: once for the least 4 significant bits and once for the most 4 significant bits.+Description:​ [MOVe values (extra B)Move the value from register $b to $a$a=$bNotice that only 2 bits have been allocated for the $a register, even though there are 8 registers. $a registers may only select general registers. (00 selects $G011 selects $G3)
 ---- ----
 Instruction:​JE\\ Instruction:​JE\\
-Format: | 000aaabb ​|\\+Format: | 010aaabb ​|\\
 Description:​ [Jump if Equal] Jump to a different location in the program if the equal condition is met. The program counter will be set to the value located in $JP when the value at register $a is the same as the value at register $b. Note that because there are 2 bits for b, $b will always be a general register. (00 selects $G0, 11 selects $G3). For an unconditional branch, set $a=$b. Description:​ [Jump if Equal] Jump to a different location in the program if the equal condition is met. The program counter will be set to the value located in $JP when the value at register $a is the same as the value at register $b. Note that because there are 2 bits for b, $b will always be a general register. (00 selects $G0, 11 selects $G3). For an unconditional branch, set $a=$b.
 +----
 +Instruction:​ADDR\\
 +Format: | 011aaaxx |\\
 +Description:​ [ADD Register] Add a register value to the accumulator. $ACC = $ACC + $a.
 ---- ----
 Instruction:​ADD\\ Instruction:​ADD\\
-Format: | 000iiiis ​|\\+Format: | 100iiiis ​|\\
 Description:​ [ADD] Add an immediate value to the accumulator. If s=0, then $ACC=$ACC+0000iiii. If s=1, then $ACC=$ACC+iiii0000. Description:​ [ADD] Add an immediate value to the accumulator. If s=0, then $ACC=$ACC+0000iiii. If s=1, then $ACC=$ACC+iiii0000.
 ---- ----
-Instruction:​ADDR\\ +Instruction:​RES\\ 
-Format: | 000aaaxx ​|\\ +Format: | 101xxxxx ​|\\ 
-Description:​ [ADD RegisterAdd a register value to the accumulator. $ACC = $ACC + $a.+Description:​ [RESetReset the accumulator ​to zero. $ACC = $Z.
 ---- ----
-Instruction:​END\\ +Instruction: ​TW\\ 
-Format: | 000xxxxx ​|\\ +Format: | 110aaaxs ​|\\ 
-Description:​ [END programStop the CPU from running. The CPU must be restarted manually.+Description:​ [Transfer WordIf s = 0, store a byte from the register file to the data memory. The value in register $a will be stored to the address in the data memory indicated by $DMP. If s=1, load a byte from the data memory to the register file. The value stored in the address in the data memory indicated by $DMP will be stored to register $a. 
 +---- 
 +=== Final Schematic === 
 +The following is the final overall schematic of our 8-bit CPU
 +{{ :​2014:​circuitdiagram.jpg |}} 
 +The following is a table depicting how the values of each flag is calculated 
 +{{ :​2014:​8bitminecraftcputable2.jpg |}} 
 + 
 +==== Building the World ==== 
 + 
 +In order to build the world, we used a mod pack called Feed The Beast Ultimate. It contains many different mods which made this project possible. The main mod we used was called RedPower, which contains many different logic gates and other circuit components with which we could build our CPU with. We then used MCedit to copy and paste large chunks of repeatable blocks. The following videos show off our world and CPU, and help give a sense of how we built it. 
 + 
 +[[http://​youtu.be/​k8AO30he_Dg|CompArch Project 8-Bit Minecraft CPU pt.1]]\\ 
 +[[http://​youtu.be/​4YIL3sc24nk|CompArch Project 8-Bit Minecraft CPU pt.2]] 
 + 
 +===== Future Work ===== 
 + 
 +We spend a lot of time on this, but there is still a lot of work that can be done on this. For this reason, we are releasing all of our documentation and our world. All instructions will be included in this [[https://​drive.google.com/​file/​d/​0Bw24Rv3qYoQdaHlaUVBwWU9jSWs/​view?​usp=sharing|zip file]]. The following improvements are to be made: 
 +  * Minimizing glitches 
 +  * Optimizing speed 
 +  * Optimizing space 
 +  * Expanding CPU Size 
 +  * Automated Loading of Instruction Memory.
  
 +Please enjoy!
2014/8-bit_minecraft_cpu.1418805304.txt.gz · Last modified: 2014/12/17 03:35 by siddthesquid