Description of the test bench

In order to verify the correctness of a modelled circuit, we have to put the circuit in a test bench, where we give all possible input combination (if possible), or at least a relevant set of input combinations, and verify the outputs

Entity

Architecture

The simulation results

  • If we look at the waveforms produced by the simulator, we see that the signals z_s, z2_s andz3_s are all identical, with an exception between the simulation moments 1020 ns and 1030 ns, when, for 10 ns, the signals z2_s and z3_s have the value '1', while z_s is '0'.
  • A detailed explanation will be given when we will discuss hazards.
  • For now, we can see from Fig 15 that, from input s to the output z, there are two different paths, with a differen number of circuits:
    1. the "upper path": s -> invgate -> sn -> upper and2gate -> asn -> or2gate -> z
    2. the "lower path": s-> lower and2gate -> sb -> sb -> or2gate -> z
  • On the upper path there is one more gate (the invgate) compared to the lower path.
  • This makes that for 10 ns, between the moment 1010 ns, to the moment 1020 ns, both paths from the data inputs (a and b) to the output z are open in the same time. Normally, only one path should be open at any time.
  • Because of that, the output z will have the value '1', instead of '0', between the moments 1020 ns and 1030 ns.
  • It means that the structural description and the data-flow description are the most realistic ones, being closer to reality than the sequential description.

  • In conclusion, the data-flow description is as realistic as the structural description, but the code is more understandable and less error-prone.