Explorar o código

Cleanup the document

Baglio Tabifata %!s(int64=4) %!d(string=hai) anos
pai
achega
a29a4dc13b
Modificáronse 1 ficheiros con 21 adicións e 21 borrados
  1. 21 21
      docs/Black_Box_Analysis.md

+ 21 - 21
docs/Black_Box_Analysis.md

@@ -4,55 +4,55 @@
 
 ### Combinatorial PALs and bruteforcing
 
-Combinatorial PAL are built around an ideal internal network of wires, whose interconnections are broken at flashing time. These wires then connect the inputs to an array of AND gates, whose outputs are connected to an array of OR gates (the physical implementation of a sum of products).
+Combinatorial PALs are built around an internal network of wires, whose interconnections are broken at flashing time. These wires connect the inputs to an array of AND gates, whose outputs are in turn connected to an array of OR gates (implementing a sum of products).
 
-Even when the chip lock is set (thus blocking direct reading via a programmer), recovering the functions that then map the internal connections is relatively easy: the output state is dependant only on the current state of the inputs and nothing else, making the creation of a truth table a trivial matter: just feed the PAL every combination of inputs and record the outputs.
+Even when the chip lock is set (thus blocking direct reading via a programmer), recovering the functions that map the internal connections is relatively easy: the output state is dependant only on the current state of the inputs and nothing else, making the creation of a truth table trivial: just feed the PAL every combination of inputs and record the outputs.
 
 ### Registered PALs
 
 Things get a bit harder when we consider registered PALs: these ICs add an array of flip-flops to the network.
-These flip-flops have one of their outputs connected to a pin and another feeding back into the network of wires. A **clock** pin is also added to the IC so that the flip-flops can be toggled.
+These flip-flops have one of their outputs connected to a pin and the other feeding back into the internal network. A **clock** pin is also brought out to an external pin so that the flip-flops can be toggled.
 
-This boils down to the fact that, when toggling the clock, the new value of the outputs connected to the flip-flops is no longer dependant on the inputs alone, but also on the feedback lines coming from the flip-flops themselves, i.e. when the clock is pulsed, the PAL changes its internal state, and the new state is dependant on the previous one.
+When toggling the clock, the flip flop take their new value not only from a combinations of the inputs, but also from the feedback lines coming from out of the flip-flops themselves, i.e. when the clock is pulsed, the PAL changes its internal state, and **the new state is dependant on the previous one**.
 
 ## Analyzing a registered PAL device
 
 ### The Not-So-Black Box
 
-As I hinted at in the introduction, a registered PAL device can be viewed as a stateful system, whose current state is dependant on the previous one plus the state of the inputs at the time of moving to the new state.
+From what I wrote in the introduction follows that a registered PAL device can be viewed as a stateful system whose current state is dependant on the previous one combined the state of the inputs at the moment the state is changed.
 
-Luckily for us, the number of the possible states is known and dependant on the number of flip-flops in the device (and, as every flip-flop is connected to a specific output, dependant on the number of so called **registered outputs**). Having said flip-flops directly connected to outputs gives us an important insight on the PAL, as *we know exactly in which state it is at the moment*.
+Luckily for us, the number of the possible states is known and dependant on the number of flip-flops inside the device (and, as every flip-flop is connected to a specific output, equal to the number of possible combinations that can be taken by the so-called **registered outputs**). Being connected directly to output pins, these flip-flop give us an important insight on the status of the PAL: *we are able to identify exactly in which state it is at the moment*.
 
 To summarize and simplify, a registered PAL has the following types of outputs:
 
-- **Combinatorial outputs**: their state is dependant on the current state of the inputs and on the current state of the registered output feedbacks.
-- **Registered outputs**: these only change when the clock pin is pulsed, and their new state depends on the state of the inputs and on their own state before the pulsing.
+- **Combinatorial outputs**: their state is dependant on the current state of the inputs and on the current state of the registered outputs (via their feedbacks).
+- **Registered outputs**: these only change when the clock pin is pulsed, and their new state depends on the state of the inputs and on their own feedback before the pulsing.
 
 ### Unboxing the PAL
 
-So, we saw that a registered PAL is a state machine, and that the current state is tied to the flip-flops, which are in turn connected to the registered outputs.
+It is now clear that a registered PAL is a state machine whose current state is tied to the flip-flops, in turn connected to the registered outputs.
 
-The number of these registered outputs depends on the PAL model, but is fixed and known for every specific model. From this we can gather that **a registered PAL device has 2^X possible states**, where **X is the number of registered outputs for that model**.
+The number of these registered outputs depends on the PAL model, but is fixed and known and cannot be changed via programming. From this we can gather that **a registered PAL device has 2^X possible states**, where **X is the number of registered outputs for that model**.
 
-I will call these states that are defined by the registered outputs "**MacroStates**", to distinguish them from another type of state, the **SubStates**, which I'll describe below.
+I will call these states defined by the registered outputs "**MacroStates**", to distinguish them from another type of state, the **SubStates**, which I'll describe below.
 
-While the **MacroState** is defined by the status of the registered outputs, we also need to take into account the state of the combinatorial outputs. The combinatorial outputs stat, is dependant only on the inputs and the registered outputs, and changes without the need of pulsing the clock.
+While the **MacroState** is defined by the status of the registered outputs, we also need to take into account the state of the combinatorial outputs. The combinatorial outputs state is dependant only on the inputs and the registered outputs, and changes without the need of pulsing the clock (we can think each MacroState in a registered PAL as a single simple combinatorial PAL).
 
-From this we get that for every MacroState we need to test all the input combinations to find the SubStates corresponding to them. For every MacroState we'll have 2^Y, where Y is the number of the combinatorial outputs, possible SubStates, but we'll have to try 2^Z combinations, where Z is the number of the inputs.
+From this we get that for every MacroState we need to test all the input combinations in order to calculate their corresponding SubStates. For every MacroState we'll have 2^Y possible substates, where Y is the number of the combinatorial outputs, but we need to map them to 2^Z combinations of inputs (Z is the number of the input pins).
 
 #### Some simple math
 
 We can see that for a registered PAL we have:
 
 - 2^X theoretically possible MacroStates.
-- 2^Z combinations of inputs for every MacroState, every combination maps one of the 2^Y possible SubStates for that specific MacroState.
-- 2^Z combination of inputs that can bring forth a movement to another MacroState when coupled with a clock pulse.
+- 2^Z combinations of inputs for every MacroState, every combination maps to one of the 2^Y possible SubStates of that specific MacroState.
+- 2^Z combination of inputs that could bring forth a movement to another MacroState when coupled with a clock pulse.
 
 Where:
 
-- X is the number of registered outputs
-- Y is the number of combinatorial outputs
-- Z is the number of inputs
+- X is the number of registered output pins.
+- Y is the number of combinatorial output pins.
+- Z is the number of input pins.
 
 #### PAL as a Graph
 
@@ -60,9 +60,9 @@ The inner workings of a registered PAL can then be represented by a **directed g
 
 - Every MacroState will have 2^Z StateLinks (edges) coming out of it, some pointing to another MacroState, some pointing back at itself.
 - We will have 2^X MacroStates (vertices) in the graph. Some will be connected to others, some will not be connected at all, depending on the programming of the device.
-- Every MacroState will contain an array of 2^Z SubStates inside, defining all the possible states that the combinatorial outputs can take within that MacroState, by trying different input combinations.
+- Every MacroState will contain an array of 2^Z SubStates inside, defining all the possible states that the combinatorial outputs can take within that MacroState, while receiving different input combinations.
 
-Reversing the inner working of the PAL device means that we need to find every possible StateLink (edge) in the digraph, and calculate all the SubStates for every MacroState (vertex) we reach.
+Reversing the inner working of the PAL device means that we need to find every possible StateLink (edge) in the digraph, and calculate all the SubStates for every MacroState (vertex) we can visit.
 
 One this is done, we can use the graph we built to print out a truth table that represents all the possible states of the PAL, and from that, recover the logic equations.
 
@@ -74,5 +74,5 @@ We can summarize the algorithm to build the graph this way:
 2. If the state was not yet visited, build the array of its substates by trying all the input combinations and registering the outputs.
 3. Check if we have still unvisited StateLinks for this MacroState
     - If we have unvisited links, pick the first and visit it. Go back to 1.
-    - If we have no unvisited links, search a path in the graph to a visited MacroState with yet unvisited links and follow it. Go back to 3 after following the path.
+    - If we have no unvisited links, search a path in the graph to a visited MacroState with yet unvisited links and follow it. Go back to 3 after following the path and feeding the PAL the input combinations.
         - If no visited MacroStates with unvisited links are found, we completed our mapping.