I wasn't able to find any material related to this topic, so I'm going to post it here.
In this thread I'm going to provide some basic facts that prove that it is possible to emulate any computer architecture in Excel (or any Excel-compatible software). I'm going to provide some fundamental digital logic that can be easily implemented in Excel.
I'm planning to extend this thread over time.
Basic stuff (combinational logic)
Firstly, you'll need to enable iterative calculations. This allows you to create flip-flops or any other circuits that have any feedback.
Different connections will be stored in different cells. Cells can take two values (for now, at least): 1 and 0.
So let's create the NOT function.
NOT(0) = 1
NOT(1) = 0
There are two ways to implement it:
1. = 1 * NOT(cell)
NOT(cell) will return TRUE or FALSE (the values will change depending on your language), so we have to convert the result to integers.
Sequential logic is the one that allows for feedback, i.e. some input of a sequential circuit can reference its output. Remember to enable iterative calculations in Options.
D flip-flop acts like a D latch, but it stores D on the rising edge of the CLK signal, i.e. when it transitions from 0 to 1. You can build it in a master-slave configuration like this:
It is unreasonable to perform complex operations on numbers using discrete logic gates, so you can use the standard addition, subtraction, lookup etc. functions. However, you might want to convert multibit integers into discrete signals and vice versa.
For splitting, the easiest solution is to convert the number into binary and then split the binary number as a string.
For combining the signals, you can concatenate all the bits and then convert the final string to a decimal number.
This formula checks if the time is even or odd. FREQ is the frequency of the clock in Hz. Update the clock by holding the button that is assigned to recalculate everything. (I think it is F9)
As an alternative, you can select an empty cell and hold Ctrl+R.
For convenience, you can assign the clock cell some name like "CLK".
You could also create a manual clock and a button to switch between the two.
I wasn't able to find any material related to this topic, so I'm going to post it here.
In this thread I'm going to provide some basic facts that prove that it is possible to emulate any computer architecture in Excel (or any Excel-compatible software). I'm going to provide some fundamental digital logic that can be easily implemented in Excel.
I'm planning to extend this thread over time.
Basic stuff (combinational logic)
Firstly, you'll need to enable iterative calculations. This allows you to create flip-flops or any other circuits that have any feedback.
Different connections will be stored in different cells. Cells can take two values (for now, at least): 1 and 0.
So let's create the NOT function.
There are two ways to implement it:
1. = 1 * NOT(cell)
NOT(cell) will return TRUE or FALSE (the values will change depending on your language), so we have to convert the result to integers.
2. = (1 - cell)
...because 1-0=1 and 1-1=0.
The second way is a bit unusual but it's shorter.
As you can see, I'm using some color coding:
I hope it doesn't require any explanation.
Other gates are also very easy to make:
Logic gates
Full adder
Notice that:
1. AND(x;y) can be replaced with (x*y) or (x+y)=2
2. OR(x;y) can be replaced with:
a) 1-((1-x)*(1-y))
(x+y)>0
3. XOR(x;y) can be replaced with (x<>y)
4. XNOR(x;y) can be replaced with (x=y)
Sequential logic
Sequential logic is the one that allows for feedback, i.e. some input of a sequential circuit can reference its output. Remember to enable iterative calculations in Options.
SR latch
SR Latch
Basically, an SR latch is a circuit that can be either set (S) or reset (R) and keeps its state if (S NOR R).
D latch
D latch
TL;DR: D (or DE) latch stores the bit in D when the signal E is 1.
D flip-flop
D flip-flop
D flip-flop acts like a D latch, but it stores D on the rising edge of the CLK signal, i.e. when it transitions from 0 to 1. You can build it in a master-slave configuration like this:
Splitter
It is unreasonable to perform complex operations on numbers using discrete logic gates, so you can use the standard addition, subtraction, lookup etc. functions. However, you might want to convert multibit integers into discrete signals and vice versa.
For splitting, the easiest solution is to convert the number into binary and then split the binary number as a string.
For combining the signals, you can concatenate all the bits and then convert the final string to a decimal number.
.
And it works!
Clock
This formula checks if the time is even or odd. FREQ is the frequency of the clock in Hz. Update the clock by holding the button that is assigned to recalculate everything. (I think it is F9)
As an alternative, you can select an empty cell and hold Ctrl+R.
For convenience, you can assign the clock cell some name like "CLK".
You could also create a manual clock and a button to switch between the two.
All the other things...
...will probably be listed in this reply.
How can I get this excel sheet "microprocessor-in-excel"