Making a 16-bit Computer in Gimkit! (Chapter 1: CPU; Part 1: Instruction Set and CPU)

Hey guy! :waving_hand:

In my 1-2 years of being inactive, I’ve been taking many programming and computer science classes

My main reason for returning is I wanted to apply my knowledge to GKC!

This first part I will be explaining what and how a CPU works in the simplest terms and we will be designing an instruction set!

CPU stands for Central Processing Unit. What it does is it processing inputs. For example, a calculator. Let’s say you want to do 1+1. The CPU would take the 2 inputs (1 and 1), and do something to it and KABOOM! Now it’s a 2! A CPU can do a lot more than just add numbers!

Computers sadly can’t understand stuff like “add one and one,. They can only understand strings of 0 and 1, for example “10101110001,. This is also known as binary. Sometimes, binary numbers are too long to write out. This is where hexadecimal comes in! Computers can easily convert hexadecimal into binary, and hexadecimal is very short.
Decimal to Binary
Decimal to Hex
Binary to Hex
For now, use these converters I have linked because I don’t feel like teaching how to convert it.

Next up I want to explain the components of a CPU

  1. Clock: Synchronizes inputs and outputs
  2. ALU (Arithmetic Logic Unit): Does addition, subtraction, multiplication, and division
  3. Registers: Short-term memory to hold data that is waiting on being processed
  4. CU (Control Unit): Tells the CPU what to do

Now, this isn’t really a component of the CPU, but it’s important for it to function: ROM (Read-Only Memory). This type of memory is permanent and cannot be changed. It holds the instruction set (which we will talk about soon), operating system, and more, but for simplicity the ROM will only be used to hold the instruction set.

The final part here is the instruction set. Think of the instruction set as the computer’s own coding language! We will design an instruction set right now!

First of all of course we need the arithmetic functions!

ADD
SUB
MULT
DIVI

Next we need a function to take data from RAM (Random Access Memory) to put it into a register to be processed, and one to do vice versa, which is take data from a register and put it into RAM.

LOAD
STORE

Here’s the formatting I will use:

ADD, SUB, MULTI, or DIVI( reg no., reg no. )
LOAD or STORE( reg no., byte no. in RAM )

Guys please forgive my lack of formatting i’m still re learning markdown and also I PROMISE THE NEXT PART WILL HAVE STUFF IN GKC IM VERY SORRY IF THIS IS OFF TOPIC I DIDNT WANT TO OVERLOAD YALLS BRAINS WITH TOO MUCH

i will try to answer all y’all’s questions

13 Likes

gng i feel like i being ignored :sob:

i doubt yall fully understand this so please ask questions i will gladly explain anything you need :slight_smile:

3 Likes

Don’t worry, we’re here reading this

Most of us don’t have questions, so we’ll stop by and give a like when needed.

3 Likes

So is this first part just explaining the basics of computing?

2 Likes

This is really cool, but it doesn’t make any connections to Gimkit Creative. Perhaps you should say what devices you would use to replicate some of these? Properties, counters, checker, or a trigger if applicable?

4 Likes

yes, i’ll get into building the different components in later parts

if you want to follow along with the series i recommend you read this guide

Logic Gates in Blocks in Gimkit Creative! (Difficulty :orange_square:) (And gate, or gate, nor gate, etc.)

3 Likes

ty!

yeah ik that this is slightly off topic, i can add some of the stuff you recomended

1 Like

Ahhh. So this is just a base to look at once the later parts discuss the Gimkit Creative aspect, right?

2 Likes

This is really incredible dude. We need the next part!

4 Likes

spot on! this part didn’t have any stuff directly related to gkc because i was explain the core of the project

3 Likes

this part was the easiest to make. going on new sections will take at 6-7 weeks to make at most

6 Likes

Thanks for the clarification! This should make the next parts easier to understand when they release. I can’t wait!

2 Likes

I have a question:
how do you do the ram
I am working on a 4 bit cpu in gkc

3 Likes

He hasn’t gotten to that part yet. This is just explaining computing in general, as a reference for the later guides.

In his own words:

2 Likes

oh. sorry

2 Likes

No need to apologize, it was a bit confusing for all of us.

I know how to do the alu and logic gates and control unit but not ram

Nice job on explaining this.
A suggestion would be to make your guide more readable(grammar, spelling, structure, formatting, etc).
Another suggestion is to expand on what a general ALU can also do(logical operations like AND, OR, XOR, etc), but you might choose to save that for future chapters/parts.
Hope to see this finished!

PS:
Another idea you could try adding to some part in your guide series would be to make a diagram of the specific architecture you’ll be using for your computer. This way people can easily understand how things connect, and what the computer is made up of.

3 Likes

The next part will be around logic gates (and not or nor nand xand xor imply nimply) and I haven’t been on here for a year I’m still relearning markdown

2 Likes

Bump.

1 Like