I've Got A Mana Processor In A Magic World
Chapter 153 153: Designing His ALU (1)
Immediately Zephyr entered his mana core space, he went straight into the process of designing.
First, he thought of what exactly the ALU was.
Just like he had told Komi, it was essentially a calculator. In his case, a spell calculator.
But what he did not tell Komi were the specifics.
Essentially, his ALU's function on the smallest level you could think of it, was to take a single Bit of spell information — a spell fragment that was part of a whole — and blend with another different spell fragment through arithmetic operations like adding and subtracting, to achieve a new spell effect.
Like blending the spell fragment of a barrier spell with another of a fire spell.
But that was at the smallest level. A single Bit.
The information gotten from both Bits would be too small to form any real spell… only a part of it.
So all he needed to do was scale it up. This same calculation logic was what he needed to apply to a group of 64 bits that could, all together, hold and form whole, coherent spells.
On this scale, when he did the same calculations for the same effect, it could now be thought of as adding a barrier spell with a fire spell to create a fire barrier spell.
It would give him a lot of control and flexibility over spells in such a way that he'd stop thinking of one spell as a fixed, separate thing. He'd become a spell designer without limits on the fly… further differentiating him from others.
That was the main idea of what he was about to design.
He then moved to the specifics of it.
How was he to add and subtract spell fragments? When, even at the Bit level, they were simply represented as 1s and 0s, states of On and Off, Yes and No… Only two conditions…
Thankfully Aegis had been there to shed light on the logic, paving a clear path for Zephyr.
In essence, calculations, only with 1s and 0s could be done with a basic idea… something Aegis called Binary language.
One had to remember that the 1s and 0s were just ways to understand the states of the Bit. It was more correct to keep the idea of On and Off at the back of the mind when doing the calculations.
Where 0 + 1 = 1, 1 + 0 = 1 and 0 + 0 = 0.
It was a simple logic where if even one of the two bits being added was on, it would pass cleanly to the output as on.
In spell fragments, it was like knowing which spell fragments at the smallest scale should take priority in that part of the spell to achieve the merged effect stably.
In some parts, one spell fragment would take priority, while in some other parts, the other spell fragment would also take priority.
But inevitably, there were still going to be parts of the spell where both spell fragments were present. On — Yes — 1…
And in this case, the real logic of the ALU begins.
Since there was no way to represent the number '2' exactly like that in Binary… another way needed to be created…
10.
The number 10 was the equivalent of '2' in Binary. 1 On and an Off.
But then the next issue with this logic arose.
There was no way to fit two numbers — two states — into the slot of one…
The slot where the sum of the two spell fragment states was supposed to be outputted to could only hold one state, either on or off.
So to solve this, just like with normal everyday additions and subtractions, the 1 in front of the 0 would be carried on to the next column of spell fragment.
Just like adding two numbers in the real world, like 27 + 13.
Placing 27 on top of 13, one would start from the right, taking 7 + 3 first, and getting 10. The 0 would be put in the empty sum slot below like normal, and the 1 would be carried on to the next column, making it 2 + 1 + the carried over 1…
This was the same logic with Binary.
The 1 was the carry.
And so the whole logic was: 0 + 1 = 1, 1 + 0 = 1, 0 + 0 = 0, and 1 + 1 = 0… bearing in mind its 1 had been carried on to the next column.
And for subtractions, it was the same, but the carry's state would be flipped to negative '-1' and subtracted from the next column.
This was how calculations using only with two conditions — On and Off — was carried out.
In Zephyr's mana node, what he'd use to make these calculations were called Adders.
Adders were made from Logic gates, specifically the XOR gate (Exclusive OR gate), AND gate… and an OR gate also.
Logic gates were always the building blocks for everything.
And when they were arranged in a specific manner, using these three gates, they created a Full Adder.
In the 64 bit design Zephyr had started building his mana processor on — mainly to have enough bits to form a full spell at once — the Adders would sum the state of two of the 64 bit spell fragments, and pass the carry on to the next, and then the next, and then the next…
This was a simple Ripple Carry Adder.
And in Zephyr's case, a 64 bit Ripple Carry Adder.
It was a design that kept passing the 'carry' to the next adder like a ripple effect.
This was straightforward and simple. It could do the calculations required to achieve spell tweaking, and Zephyr could even end it there if he wanted.
But Zephyr always chased more. Why settle for less when you knew better?
With a Ripple Carry Adder design — while on the grand scale it was still really fast — he would have to wait for the carry to pass on to each adder step by step.
In reality, if Zephyr went with this design, combining and tweaking spells to his taste would still happen within a second to a few seconds at most…
But if one could zoom in and see the process as it happened, one would find that most of the 'one to a few seconds' spent waiting for the spell combination to actualize was just wasted time…
For the most of their time, the Adders were just doing nothing, simply waiting for their turn for the carry to reach them.
They were ready to calculate the addition, or subtraction of their two spell fragment values — their two Bits, but they had to wait because they did not know whether the carry coming their way was a 0, meaning their own calculations would be correct, nothing extra to add or subtract… or it would be a 1 or -1, and they needed to factor that into their calculation…
So they needed to wait for the carry, even though they were ever ready to calculate.
Zephyr couldn't afford this kind of wasted time when he knew there was a better option that had been developed to address this.
So instead of of going down that route — the route of the Ripple Carry Adder — he went with a better design.
The Carry-Lookahead Adder design!