Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scratch:tutorial_2_-_more_combinational_gates [2020/11/03 05:41]
ole created
scratch:tutorial_2_-_more_combinational_gates [2020/12/02 01:00] (current)
Line 1: Line 1:
 ====== Simple combinational gates ====== ====== Simple combinational gates ======
  
-In this tutorial we will go a step further and look at multiple inputs and how to connect cells.+In this tutorial we will go a step further and look at multiple inputs, local variables and how to connect cells, as well as a more complex simulator.
  
 The following specifies a number of combinational gates, where the process names correspond to the commonly used names for the gates. The following specifies a number of combinational gates, where the process names correspond to the commonly used names for the gates.
Line 28: Line 28:
 </code> </code>
  
-While the inverter syntax should be familiar from the previous example [[scratch:tutorial_1_-_a_simple_inverter]], you can also define multiple inputs as seen in the nand2 example. It uses '','' to create multiple variables of the same type. For ''nand2'' and ''nor2'', there are three variables in the port list. ''a'' and ''b'' have the same type (''bool?''), whereas ''c'' has a different type (''bool!'').+While the inverter syntax should be familiar from the previous example [[scratch:tutorial_1_-_a_simple_inverter]], you can also define multiple inputs as seen in the nand2 example.  
 + 
 +==== Multiple in/outputs ==== 
 + 
 +It uses '','' to create multiple variables of the same type. For ''nand2'' and ''nor2'', there are three variables in the port list. ''a'' and ''b'' have the same type (''bool?''), whereas ''c'' has a different type (''bool!'').
  
 If we wanted to create a two-input and gate, we could simply write: If we wanted to create a two-input and gate, we could simply write:
Line 40: Line 44:
 } }
 </code> </code>
 +
 +==== Local variables and CMOS implementability ====
  
 This would be accepted by ACT, and the production rule simulator [[tools:prsim|prsim]] can simulate such rules without difficulty. However, a CMOS circuit designer would observe that one cannot implement this directly using a single pull-up and pull-down network in static CMOS. Instead, someone used to circuit design would write: This would be accepted by ACT, and the production rule simulator [[tools:prsim|prsim]] can simulate such rules without difficulty. However, a CMOS circuit designer would observe that one cannot implement this directly using a single pull-up and pull-down network in static CMOS. Instead, someone used to circuit design would write: