Skip to main content

Posts

DESIGNING A RELAY COMPUTER: Registers and The Data Bus

In the previous post I explained how to make single bit memory circuit using relays. In a computer however, we want to deal with larger numbers not just 0 and 1. So, we can have N 1 bit memory units side by side and consider them as a single N bit number. The more bits you have clubbed together the larger a number we can store. For ease of explaining lets just consider four 1 bit memory units together. These four bits can together can also be called a "4 bit register". The right most bit with the lowest place value is called the LSB (Least Significant Bit) and the left most bit having the highest place value is called the MSB (Most Significant Bit). Now, with this four bit memory unit we can save any number from 0 to 15 i.e., from 0000 to 1111. A memory register is of no use if it does not have DATA lines for us to read from or write to, so lets add them first... In order to read and write to the register we also require read and write control lines. This is how they ...

DESIGNING A RELAY COMPUTER: The Memory

We often judge a computer by its memory. This because a larger memory allows you run larger and more complex programs. But, what does memory actually mean? where is this data actually stored? how does memory in a relay computer work? The idea of memory is very straight forward. If an object, having multiple states/configurations, is put in one of its states and it stays in that state indefinitely it can be called a memory unit. For example a tally counter: You can set any 4 digit decimal number on a tally counter and that number stays as it is indefinitely unless it is reset or rewritten. So a tally counter is a 4 digit memory and each digit has ten states and hence it can save any number from 0 to 9999. By the same concept a latching Switch that we use daily to control home appliances is also a form of memory. A simple latching switch is a single bit memory unit i.e. it saves a single binary digit having only two states ON and OFF. Since each switch denotes 1 bina...

DESIGNING A RELAY COMPUTER: The Negative

When we hear about negative numbers the symbol " - " comes to mind since the use of the symbol seems to make any number negative. As human beings it is pretty easy to think about negative numbers and deal with the " - " symbol. But for a computer we need a binary notation for this too since there is no way of representing " - ", it either has to be a 0 or 1. In this post I will try and show the various ways one could write negative numbers in binary and whether or not they are suitable for doing mathematics. To test if the representation method is appropriate we can try doing a simple arithmetic operation such as subtraction. If the result generated after the operation matches the correct result, we can be sure that the system of representing the numbers works. Sign Magnitude: To solve the problem of handling negative numbers we can device a simple solution of using an extra bit on the left of the number and call it the "Sign Bit". The re...

DESIGNING A RELAY COMPUTER: The Adding Machine

In a CPU there is circuitry dedicated to do all kinds of arithmetic operations and logical operations on binary numbers. Adders are circuits that reside in this ALU section of the CPU and they, as the name suggests, add numbers. So, how exactly does a circuit add binary numbers?? As I had previously mentioned in my post talking about number systems, certain properties of numbers remain the same regardless of the base of the number system. So, adding two binary numbers is similar to adding two decimal numbers. Lets first look at how we add decimal numbers. Suppose we were to add two 3 digit numbers: To add these two numbers first we add the numbers in the units place. Upon adding the two numbers we get either a single digit answer or a double digit answer. If the answer is a single digit it is considered the units digit of the final sum and we add the digits of the next place value. If the answer is a two digit number the units place of the answer is considered as ...

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 ...

DESIGNING A RELAY COMPUTER: Logic Gates

I remember studying about logic gates for the first time in a computer class in school, AND, NAND, OR, NOR, NOT, XOR gates. It sounded like the stupidest thing I had ever learnt. Added to that it was too easy to even be worth teaching. And why would anyone teach it in a computers course anyway?? Has it got anything to do with computers?? The answer, Yes, it has everything to do with computers. The fact that a digital computer exists is because of logic gates. All of the decisions a computer takes and the tasks a computer does are dependent on logic gates. It was only in college during my Digital Electronics course did I finally recognize the power of logic gates. Although its self explanatory, let me first explain what a gate is. A gate is a device that allows an event to happen. It controls when the event happens and for how long that event happens. For eg. the switch acts as a gate for the light bulb since its operation determines when the light is switched ON and for how ...