Level/Adding Bytes: Difference between revisions

From Turing Complete
(Created page with "In this level, you are tasked with designing a component that can ADD together two byte values. To accomplish this, you will need to use the 1-bit Adder component you created earlier on to perform bitwise addition on the two numbers. To complete the level, you will need ''two'' '''Byte Splitter''' components, a '''Byte Maker''' component, and ''eight'' '''1-bit Adder''' components. First, hook up each byte input node to a Byte Splitter, so you can start working...")
 
(Added infobox)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
In this level, you are tasked with designing a component that can ADD together two byte values. To accomplish this, you will need to use the 1-bit Adder component you created earlier on to perform bitwise addition on the two numbers.
{{Infobox level
| section            = Arithmetic
| type                = Component
| prerequisite1      = Double the Number
| prerequisite2      = Full Adder
| prerequisite3      = Bit Switch
| unlocks-level1      = Negative Numbers
| unlocks-level2      = Input Selector
| unlocks-component1  = Add
| scored              = Yes
| highscore          = 83
| api-enum-id        = byte_adder
| api-enum-number    = 16
}}


To complete the level, you will need ''two'' '''[[Byte Splitter]]''' components, a '''[[Byte Maker]]''' component, and ''eight'' '''1-bit Adder''' components. First, hook up each byte input node to a Byte Splitter, so you can start working with each value bit-by-bit. Next, for each pair of bits between each byte value (each first bit, each second bit, etc.), you will need to use one Adder component to perform addition on the two bits. For each pair of bits between the two bytes, hook them up to a 1-bit Adder component to add the two bits together. Consolidate the outputs of each Adder using a Byte Maker component, and link its restored byte output to the level's byte output node.
In this level, you are tasked with designing a component that can ADD together two byte values. To accomplish this, you will need to use the 1-bit Adder component (call Full Adder) you created earlier on to perform bitwise addition on the two numbers.


Also notice that the level has an input and an output for a Carry bit. This is where the third bit in the 1-bit Adder component comes in handy, as it allows those components to be chained together in order to add together arbitrarily large numbers. To integrate the Carry functionality into this component, first connect the level's Carry bit input node up to the third input of the first 1-bit Adder component. ext, connect the Adder component's second output to the next Adder's third input. Continue chaining the components together for each of the eight Adder components, and for the final Adder, link its Carry output to the level's Carry output node itself. From here, the level will be complete.
To complete the level, you will need ''two'' '''{{Component|Byte Splitter}}''' components, one '''{{Component|8 Bit Maker}}''' component, and ''eight'' '''{{Component|Full Adder|Full Adders}}'''. First, hook up each byte input node to a Byte Splitter, so you can start working with each value bit-by-bit. Next, for each pair of bits between each byte value (each first bit, each second bit, etc.), you will need to use one Adder component to perform addition on the two bits. For each pair of bits between the two bytes, hook them up to a Full Adder component to add the two bits together. Consolidate the outputs of each Adder using a 8 Bit Maker component, and link its restored byte output to the level's byte output node.
 
Also notice that the level has an input and an output for a Carry bit. This is where the third bit in the 1-bit Full Adder component comes in handy, as it allows those components to be chained together in order to add together arbitrarily large numbers. To integrate the Carry functionality into this component, first connect the level's Carry bit input node up to the third input of the first Full Adder component. Then connect each Adder component's second output to the next Adder's third input. Continue chaining the components together for each of the eight Adder components, and for the final Adder, link its Carry output to the level's Carry output node itself. From here, the level will be complete.

Latest revision as of 11:39, 23 August 2024

Section Arithmetic
Type Component
Prerequisites Double the Number
Full Adder
Bit Switch
Unlocks Negative Numbers
Input Selector
Add
Scored Yes
High score 83
API byte_adder (16)

In this level, you are tasked with designing a component that can ADD together two byte values. To accomplish this, you will need to use the 1-bit Adder component (call Full Adder) you created earlier on to perform bitwise addition on the two numbers.

To complete the level, you will need two Byte Splitter components, one 8 Bit Maker component, and eight Full Adders. First, hook up each byte input node to a Byte Splitter, so you can start working with each value bit-by-bit. Next, for each pair of bits between each byte value (each first bit, each second bit, etc.), you will need to use one Adder component to perform addition on the two bits. For each pair of bits between the two bytes, hook them up to a Full Adder component to add the two bits together. Consolidate the outputs of each Adder using a 8 Bit Maker component, and link its restored byte output to the level's byte output node.

Also notice that the level has an input and an output for a Carry bit. This is where the third bit in the 1-bit Full Adder component comes in handy, as it allows those components to be chained together in order to add together arbitrarily large numbers. To integrate the Carry functionality into this component, first connect the level's Carry bit input node up to the third input of the first Full Adder component. Then connect each Adder component's second output to the next Adder's third input. Continue chaining the components together for each of the eight Adder components, and for the final Adder, link its Carry output to the level's Carry output node itself. From here, the level will be complete.