Skip to main content

Making a URISC Processor: The Control Word

 In the previous post I had discussed the basic idea of the URISC processor and the 'SUBNEG' instruction. In this post I will try and explain how the various registers are controlled.

First let me talk about the control word. A control word is a a large binary number (also called a word) that is used to control the various elements in the processor.

The arrows in the block diagram show the direction in which the data can move and this can actually give us some insight to the control word. For eg, the program counter has bidirectional arrow i.e. it can read as well as write to the 16-bit address bus. So, the program counter needs a read and write control line.
Going by the same idea all the control lines can be figured out.
The table below, shows all the various control lines of each component.
In the table 'IE' is Input Enable (read line) and 'OE' is Output Enable (Write line).
The 'inc' control line is for incrementing the program counter by 1.
'RST' is for resetting the micro-instruction counter and 'WE' is the Write Enable line of the RAM.
In total there are 12 control lines hence we have a 12-Bit control word.

The idea behind the control lines is that you can transfer data from one register to another by simultaneously reading from and writing to the bus.
For eg. if we were to transfer a 16-bit address from the Memory Address Pointer (MAP) to the Program Counter (PC), we could do this by setting the control lines such that MAP writes to the bus and PC reads from the bus. In this way we successfully copy data from one register to another.

Shown above is a gif demonstrating 4-Bit data being transferred from one register to another.

When executing an instruction we need to do many such data transfers in a fixed sequence and for that we need a counter to keep track of which step of the sequence we are in and what to do next.

As a matter of fact this is exactly what the CU (Control Unit) of a processor is, a circuit that determines which step of the sequence is being currently executed and which control line should be switched ON next.

In the next post I will try explaining the micro-code counter and how the instruction is actually executed...till then.....

Got any queries???E-Mail me at: shashwath.sundar@gmail.com

Comments

Popular posts from this blog

DESIGNING A RELAY COMPUTER: Relays

In the previous posts I highlighted the various concepts that are fundamental to designing a computer. Now I think its time to mention the ways of practically applying these concepts to design a computer. The first thing I should highlight is that I will not be using transistors, I'll be using relays. This is due to the fact that its easier to understand how a relay works than to understand how a transistor works. Also, this seems to be the easiest way to understand how computers actually work since we are using mechanical switches instead of solid state switches (transistors). What is a Relay?? Relays are basically electrically controlled switches. Inside a relay is an electromagnet. when the electromagnet is powered, it attracts a metal strip that in turn operates a switch. Most widely available relays are SPDT relays or Single Pole Double Throw relays. In these relays the switch has 3 terminals- Common terminal , NO i.e. normally open terminal and NC i.e. normally ...

Making a URISC Processor: The Idea

So a while back I saw this video on Youtube by "Gary Explains" talking about a "One Instruction Set Computer". For those who do not know, a computer processor does a fixed set of things or follows a fixed set of instructions. Usually modern processors have hundreds of instructions. In the OISC or URISC (Ultimate Reduced Instruction Set Computer) processor the idea is to have one universal instruction that the processor executes that allows the programmer to write any program. The first time I heard of this idea I fell off my chair with excitement (Literally). My mind was really blown by the fact that you could write any program with just one instruction. So after going through what "Gary" on Youtube had to offer... I sat down and tried to come up with a design of this hypothetical processor that executes only one instruction. In the video Gary talked about a processor that executed an instruction called 'SUBLEQ' which simply means, SUB tract and th...

Making a URISC Processor: Micro-Instruction Encoding

 In the last post I described the micro-instructions that are to be executed to execute the SUBNEG instruction. Given below is the table I had posted previously: I realized later that it still might not be entirely clear as to how this was working so I have made a GIF of the same to better explain how the "Subtraction" instruction is executed. Pretty cool huh?.... no??? okay 😢 In The GIF it is assumed that the following data is stored in the RAM: Address    Byte #0000           #32  [B(l)] #0001         #00  [B(h)] #0002         #33  [A(l)] #0003       #00  [A(h)] #0004       #20  [C(l)] #0005       #01  [C(h)] #0032         #07 [Data] #0033       #09 [Data] The next thing we need to do is try to optimize this process. In the above GIF you may or may...