home *** CD-ROM | disk | FTP | other *** search
/ Explore the World of Soft…e: Engineering & Science / Explore_the_World_of_Software_Engineering_and_Science_HRS_Software_1998.iso / programs / electrnc / logsim21.txt < prev    next >
Text File  |  1997-09-18  |  59KB  |  1,588 lines

  1.                                     L O G S I M
  2.                              a Logic Simulation program
  3.                                     Version 2.1
  4.  
  5.                       Copyright (C), 1986 by Scott Romanowski
  6.                                 All rights reserved
  7.                          Commercial Duplication Prohibited
  8.                                  November 20, 1986
  9.  
  10.                                       Contents
  11.             
  12.             1. Introduction........................................... 1
  13.               1.1 Duplication and Use Policy.......................... 1
  14.             2. Using LOGSIM........................................... 2
  15.               2.1 Equation Syntax and Node Numbers.................... 3
  16.               2.2 Tri-State and Open Collector Outputs................ 3
  17.               2.3 Initial Conditions.................................. 4
  18.             3. Describing the Circuit................................. 4
  19.               3.1 Gates............................................... 4
  20.                 3.1.1 AND Gate........................................ 5
  21.                 3.1.2 BUFFER Gate..................................... 5
  22.                 3.1.3 DELAY Gate...................................... 5
  23.                 3.1.4 DELAYH Gate..................................... 6
  24.                 3.1.5 DELAYL Gate..................................... 6
  25.                 3.1.6 NAND Gate....................................... 6
  26.                 3.1.7 NOR Gate........................................ 6
  27.                 3.1.8 NOT Gate........................................ 7
  28.                 3.1.9 OR Gate......................................... 7
  29.                 3.1.10 XNOR Gate...................................... 7
  30.                 3.1.11 XOR Gate....................................... 7
  31.               3.2 Chips............................................... 8
  32.                 3.2.1 D Chip Descriptor............................... 8
  33.                 3.2.2 JK Chip Descriptor.............................. 8
  34.                 3.2.3 7476 Chip Descriptor............................ 9
  35.                 3.2.4 74112 Chip Descriptor........................... 9
  36.                 3.2.5 74123 Chip Descriptor........................... 9
  37.                 3.2.6 74126 Chip Descriptor.......................... 10
  38.                 3.2.7 74192 Chip Descriptor.......................... 10
  39.                 3.2.8 74193 Chip Descriptor.......................... 10
  40.                 3.2.9 74253 Chip Descriptor.......................... 11
  41.               3.3 Clocks............................................. 11
  42.               3.4 Data Sources....................................... 11
  43.             4. Simulating the Circuit................................ 12
  44.               4.1 Simulation Time.................................... 12
  45.               4.2 Rise Time Calculations............................. 12
  46.               4.3 Gate Delays........................................ 13
  47.               4.4 Initial Conditions................................. 13
  48.               4.5 Output Modes....................................... 14
  49.                 4.5.1 Display........................................ 14
  50.                 4.5.2 File........................................... 14
  51.                 4.5.3 Print.......................................... 15
  52.                 4.5.4 Fprint......................................... 16
  53.               4.6 Time Units per Screen.............................. 17
  54.               4.7 Monitoring nodes................................... 17
  55.               4.8 Fanout Lists....................................... 17
  56.             5. Chip Descriptions..................................... 17
  57.               5.1 Making New Chips................................... 18
  58.                 5.1.1 Pins, Delay, Mode and Output Pins.............. 18
  59.                 5.1.2 Chip Modes..................................... 19
  60.                 5.1.3 Output Equations............................... 19
  61.               5.2 Sample Chip Descriptions........................... 20
  62.               5.3 Simulating ROMS.................................... 20
  63.               5.4 Simulating RAMS.................................... 21
  64.  
  65.  
  66.  
  67.                                        LOGSIM
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                                                         II
  74.  
  75.  
  76.               5.5 Simulating PALs and PLAs........................... 21
  77.             
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.                                        LOGSIM
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                                                                         1
  140.  
  141.  
  142.  
  143.             1. Introduction
  144.  
  145.  
  146.                  LOGSIM is  a digital  logic simulation  program.  It is
  147.             very general and infinitely expandable.  Users create a file
  148.             describing their circuit and select options to configure the
  149.             simulation.
  150.  
  151.                  All times  in the circuit are measured in "time units".
  152.             A time  unit is  any amount of time, determined by the user.
  153.             If the  user wants to use 10 nanoseconds per time unit, then
  154.             a 100 nanosecond delay would be 10 time units.
  155.  
  156.                  Logic values  are simply  represented as  high and  low
  157.             states, the  actual voltage levels are immaterial to LOGSIM.
  158.             Tri-state and open collector outputs are handled specially--
  159.             see the section describing them below.
  160.  
  161.                  LOGSIM requires  DOS 2.1  or higher and one disk drive.
  162.             To use  the PRINT  option (graphics  timing diagram  on  the
  163.             printer), the  graphics screen  dump program included in DOS
  164.             is  required.     Using   PC-DOS,  this  program  is  called
  165.             GRAPHICS.COM, using  MS-DOS, this  program  is  one  of  the
  166.             PSCxxxx.COM programs.  See your DOS manual for more informa-
  167.             tion.
  168.  
  169.                  This manual  is written for people who have some famil-
  170.             iarity with  DOS (somewhere  between neophyte  and  wizard).
  171.             You must  be able to edit files to use LOGSIM.  Knowledge of
  172.             the print  screen command,  file  and  path  names,  default
  173.             drive, default  directory, and batch files will help, but is
  174.             not required.   It  goes without  saying, but  you must know
  175.             about digital  logic before  understanding what this program
  176.             does.
  177.  
  178.               1.1 Duplication and Use Policy
  179.  
  180.  
  181.                  LOGSIM is  distributed as  shareware.   You can make as
  182.             many copies  as you  desire, and give away as many copies as
  183.             desired.   Users may  not charge  others for  copies of this
  184.             program without  the express  written permission  of the au-
  185.             thor.  If you must charge for the disk(s) when you give away
  186.             a copy,  you may  charge no more than $1.00 (one dollar) per
  187.             disk.
  188.  
  189.                  If you  distribute this  program, you must include this
  190.             policy with  the copy.   You  may not include any portion of
  191.             this program,  modified or not, in any other program without
  192.             the written permission of the author.
  193.  
  194.                  If you are pleased with this program, the author humbly
  195.             requests that  you send  $20 to  the author.   Shareware  is
  196.  
  197.  
  198.  
  199.                                        LOGSIM
  200.  
  201.  
  202.  
  203.  
  204.  
  205.                                                                         2
  206.  
  207.  
  208.             based on  the belief  that people will gladly pay for a good
  209.             product, yet  should not  be required to pay for a bad prod-
  210.             uct.   Shareware lets  people experiment  with programs, and
  211.             form their own opinion of the product.
  212.  
  213.                  If you choose not to support the author, there is noth-
  214.             ing to  stop you from continuing to use LOGSIM.  If you sup-
  215.             port the  author, good  for you!   You  have made the author
  216.             very happy.
  217.  
  218.                  The author can be reached at:
  219.                       Scott Romanowski
  220.                       5 Sherburn Place
  221.                       Wilmington, MA 01887
  222.  
  223.                  In addition, improvements to LOGSIM are planned.  These
  224.             improvements will  speed simulation,  allow larger circuits,
  225.             allow easy  implementation of  RAM memories,  and  add  more
  226.             standard chips.   If this program generates a good response,
  227.             the author will surely distribute the updates.  On the other
  228.             hand, a discouraged author probably won't.
  229.  
  230.             2. Using LOGSIM
  231.  
  232.  
  233.                  In order to have LOGSIM simulate your circuit, you must
  234.             create a  circuit descriptor  file describing  your circuit.
  235.             To use  LOGSIM, at  the DOS  prompt, type  "LOGSIM".  LOGSIM
  236.             will reply with "Circuit Descriptor file", to which you type
  237.             the name  of the  circuit descriptor  file.  Optionally, you
  238.             can include  the name  of the circuit descriptor file on the
  239.             command line, by typing "LOGSIM filename" (where filename is
  240.             the name of the circuit descriptor file).
  241.  
  242.                  A circuit  descriptor file  consists of  two parts: the
  243.             circuit itself,  and a  list of options for LOGSIM.  The two
  244.             parts are  separated by an END statement--simply a line with
  245.             the word END.
  246.  
  247.                  A sample circuit descriptor is shown below:
  248.  
  249.                            JK H 14 1 H 2 13 3
  250.                            JK H 15 1 H 2 14 4
  251.                            JK H 5 1 H 2 15 16
  252.                            AND 5 3 4
  253.                            CLOCK 1 0000111
  254.                            DATA 2 01
  255.                            END
  256.                            TIME 60
  257.                            MONITOR 13 14 15
  258.                            PRINT
  259.  
  260.                  The first  6 lines describe the circuit (in this case a
  261.             simple 0-1-2-4  counter), the 7th line is the end statement,
  262.  
  263.  
  264.  
  265.                                        LOGSIM
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                                                                         3
  272.  
  273.  
  274.             and lines  8 through  10 are the options.  LOGSIM recognizes
  275.             both upper  and lower  case letters,  and both can be freely
  276.             mixed in your input.
  277.  
  278.                  When LOGSIM  is reading  your circuit  description,  it
  279.             displays "Reading element ..." messages to inform you of its
  280.             progress, and  to aid  in debugging  if there is an error in
  281.             your circuit  description.  After LOGSIM is finished reading
  282.             your circuit  descriptor, LOGSIM  prints "Circuit descriptor
  283.             read in" and starts simulating your circuit.  There may be a
  284.             few second  pause while  LOGSIM determines the initial state
  285.             of the circuit.
  286.  
  287.               2.1 Equation Syntax and Node Numbers
  288.  
  289.  
  290.                  Logical expressions  are only  used in  coding chip de-
  291.             scriptors.  In that case and in this manual, LOGSIM uses the
  292.             following symbols when representing logic equations:
  293.  
  294.                  ~ NOT     & AND     + OR      * XOR
  295.  
  296.                  These are  listed in order of precedence, except OR and
  297.             XOR are the same precedence.  Expressions are evaluated from
  298.             left to  right.   Parentheses (parentheses only, no brackets
  299.             [] or braces {} ) can be used to group expressions and over-
  300.             ride precedence.   This  precedence scheme can be best shown
  301.             by some examples:
  302.  
  303.                  A & B + C = C + A & B = (A & B) + C
  304.                  A + B * C = (A + B) * C
  305.                  A * B + C = (A * B) + C
  306.                  ~A & B & ~C = ( (~A) & B) & (~C)
  307.                  ~(A + B) & ~C + D = ( ( ~(A + B) ) & (~C) ) + D
  308.  
  309.                  All nodes  in LOGSIM  are numbered.  Any integer from 0
  310.             to 1,000  can be  used.   In addition, there are two special
  311.             nodes: H  (a constant  logic high)  and L  (a constant logic
  312.             low), which can be used chip input nodes.  Example: JK h 2 3
  313.             4 5  6 7  is a JK flip flop with ~PRESET tied to logic high.
  314.             Using the  nodes H or L in a gate (ex.: AND 4 H 3) is WRONG!
  315.             and will cause errors!
  316.  
  317.                  There can  be up  to one  thousand nodes  in a  circuit
  318.             descriptor.
  319.  
  320.               2.2 Tri-State and Open Collector Outputs
  321.  
  322.  
  323.                  In LOGSIM, all outputs are capable of being wired-ANDed
  324.             together (like open-collector outputs).  If you connect sev-
  325.             eral outputs together, the state at that node will be a
  326.             logic high if and only if all the outputs on that node are
  327.  
  328.  
  329.  
  330.  
  331.                                        LOGSIM
  332.  
  333.  
  334.  
  335.  
  336.  
  337.                                                                         4
  338.  
  339.  
  340.             logic highs.  If any output to that node is a logic low, the
  341.             node will be a logic low.
  342.  
  343.                  Tri-state devices  are implemented by having the output
  344.             of the  device go  high in  the high-Z  state.  For example,
  345.             consider a  tri-state  inverter  with  the  following  truth
  346.             table:
  347.  
  348.                            A  B    C (Output)
  349.                            L  X    Z (high impedance)
  350.                            H  L    H
  351.                            H  H    L
  352.  
  353.                  In LOGSIM,  this can  be represented  by  the  equation
  354.             C = ~A +  B.   Note that in LOGSIM, and this manual, the "~"
  355.             is used to show negation, "~A" means "NOT A".
  356.  
  357.               2.3 Initial Conditions
  358.  
  359.  
  360.                  Before LOGSIM  starts simulating  your circuit, it must
  361.             determine the  initial state of your circuit.  To do this it
  362.             assumes that  all nodes  start at  high logic  states, holds
  363.             clocks and data sources in their initial states, and repeat-
  364.             edly calculates  new states  for your  circuit.  During this
  365.             process, all delays in the circuit are set to one time unit.
  366.  
  367.                  You are  responsible  for  ensuring  that  the  circuit
  368.             starts in  a known state!  The easiest way is to have a data
  369.             source that  initializes the  circuit elements as necessary,
  370.             and then  goes to an inactive state after one time unit.  If
  371.             the circuit  contains unstable  elements, LOGSIM will inform
  372.             you of  that fact with a message "Element driving node xx is
  373.             unstable."
  374.  
  375.                  The INITIAL  option (see below) can be used to manually
  376.             set the state of your circuit.  If this is done, LOGSIM uses
  377.             that as the initial state and does not use this process.
  378.  
  379.             3. Describing the Circuit
  380.  
  381.  
  382.                  The circuit  description consists of a number of lines,
  383.             each of  which is an element, followed by an END line.  Each
  384.             line is either a gate, chip, clock, or data source.
  385.  
  386.                  Very Important!  Use only spaces to separate items.  Do
  387.             not use commas, or any other punctuation.
  388.  
  389.               3.1 Gates
  390.  
  391.  
  392.                  LOGSIM has  some standard  gates--AND, NAND,  OR,  NOR,
  393.             XOR, XNOR, NOT, BUFFER, DELAYH, DELAYL, and DELAY--built in.
  394.  
  395.  
  396.  
  397.                                        LOGSIM
  398.  
  399.  
  400.  
  401.  
  402.  
  403.                                                                         5
  404.  
  405.  
  406.             All the  gates have  one output node, and the AND, NAND, OR,
  407.             NOR, XOR  and XNOR  can take  up to 32 input nodes.  The NOT
  408.             gate is  a simple inverter, the BUFFER gate is a non-invert-
  409.             ing buffer,  and the  DELAY gate  is a  non-inverting buffer
  410.             with a  constant, specified  delay.   The DELAYH  and DELAYL
  411.             gates are  similar to  the DELAY gate, except that they only
  412.             delay high  or low  logic states  (respectively) by the con-
  413.             stant delay.  The opposite state (low for a DELAYH, high for
  414.             a DELAYL)  is delayed  by only 1 time unit.  These gates are
  415.             further described  below, and the default gate delay (1 time
  416.             unit +  1 time unit per input driven) formula can be changed
  417.             by the GATEDELAY option described below.
  418.  
  419.                 3.1.1 AND Gate
  420.  
  421.  
  422.                  Syntax: AND [output] [input] [input] [input] ...
  423.  
  424.                  This gate ANDs together all the input nodes and outputs
  425.             that value  to the output node.  Up to 32 nodes can be ANDed
  426.             together with  one gate.  This gate has a default delay of 1
  427.             time unit + 1 time unit per input driven.
  428.  
  429.                  Example: AND  3 1 2 5 15 will generate a high at node 3
  430.             if all of nodes 1, 2, 5, and 15 are high.
  431.  
  432.                 3.1.2 BUFFER Gate
  433.  
  434.  
  435.                  Syntax: BUFFER [output] [input]
  436.  
  437.                  This gate  is a  non-inverting buffer--the value of the
  438.             input appears at the output. This gate only takes one input,
  439.             and has a default delay of 1 time unit + 1 time unit per in-
  440.             put driven.
  441.  
  442.                  Example: BUFFER 4 5.  Node 4 equals the value of node 5
  443.             (after the gate's inherent delay of course).
  444.  
  445.                 3.1.3 DELAY Gate
  446.  
  447.  
  448.                  Syntax: DELAY [output] [input] [delay]
  449.  
  450.                  This gate is a non-inverting buffer with a constant de-
  451.             lay.   Use this  to simulate any fixed delay in the circuit.
  452.             This gate  only takes one input.  The longest delay possible
  453.             in LOGSIM is 32,767 time units.
  454.  
  455.                  Example: DELAY  12 1  10.  The value of node 1 will ap-
  456.             pear at node 12 after a delay of 10 time units.
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.                                        LOGSIM
  464.  
  465.  
  466.  
  467.  
  468.  
  469.                                                                         6
  470.  
  471.  
  472.                 3.1.4 DELAYH Gate
  473.  
  474.  
  475.                  Syntax: DELAYH [output] [input] [delay]
  476.  
  477.                  This gate  is a non-inverting buffer which delays logic
  478.             high states by a constant delay.  The longest delay possible
  479.             in LOGSIM  is 32,767  time units.   This gate only takes one
  480.             input.  For example, if the input to a DELAYH gate (with a 4
  481.             time unit delay) is the pattern:
  482.                  000011111111100000001000000, the output will be
  483.                  000000001111110000000000000.
  484.  
  485.                  Example: DELAYH  12 1 10.  The value of node 1 will ap-
  486.             pear at  node 12  after a  delay of 10 time units if it is a
  487.             logic high, or 1 time unit if it is a logic low.
  488.  
  489.                 3.1.5 DELAYL Gate
  490.  
  491.  
  492.                  Syntax: DELAYL [output] [input] [delay]
  493.  
  494.                  This gate  is a non-inverting buffer which delays logic
  495.             low states  by a constant delay.  The longest delay possible
  496.             in LOGSIM  is 32,767  time units.   This gate only takes one
  497.             input.  For example, if the input to a DELAYL gate (with a 4
  498.             time unit delay) is the pattern:
  499.                  111100000000011111110111111, the output will be
  500.                  111111110000001111111111111.
  501.  
  502.                  Example: DELAYL  12 1 10.  The value of node 1 will ap-
  503.             pear at  node 12  after a  delay of 10 time units if it is a
  504.             logic low, or 1 time unit if it is a logic high.
  505.  
  506.                 3.1.6 NAND Gate
  507.  
  508.  
  509.                  Syntax: NAND [output] [input] [input] [input] ...
  510.  
  511.                  This gate  NANDs together  all the input nodes and out-
  512.             puts that  value to  the output node.  Up to 32 nodes can be
  513.             NANDed together  with one gate.  This gate has a default de-
  514.             lay of 1 time unit + 1 time unit per input driven.
  515.  
  516.                  Example: NAND  3 1 2 5 15 will generate a low at node 3
  517.             if all of nodes 1, 2, 5, and 15 are high.
  518.  
  519.                 3.1.7 NOR Gate
  520.  
  521.  
  522.                  Syntax: NOR [output] [input] [input] [input] ...
  523.  
  524.                  This gate NORs together all the input nodes and outputs
  525.             that value  to the output node.  Up to 32 nodes can be NORed
  526.  
  527.  
  528.  
  529.                                        LOGSIM
  530.  
  531.  
  532.  
  533.  
  534.  
  535.                                                                         7
  536.  
  537.  
  538.             together with  one gate.  This gate has a default delay of 1
  539.             time unit + 1 time unit per input driven.
  540.  
  541.                  Example: NOR  3 1  2 5 15 will generate a low at node 3
  542.             if any of nodes 1, 2, 5, or 15 is high.
  543.  
  544.                 3.1.8 NOT Gate
  545.  
  546.  
  547.                  Syntax: NOT [output] [input]
  548.  
  549.                  This gate is simple inverter--the value of the input is
  550.             inverted and appears at the output. This gate only takes one
  551.             input, and  has a default delay of 1 time unit + 1 time unit
  552.             per input driven.
  553.  
  554.                  Example: NOT  4 5.   Node  4 equals  the inverse of the
  555.             value of node 5 (after the gate's inherent delay of course).
  556.  
  557.                 3.1.9 OR Gate
  558.  
  559.  
  560.                  Syntax: OR [output] [input] [input] [input] ...
  561.  
  562.                  This gate  ORs together all the input nodes and outputs
  563.             that value  to the  output node.  Up to 32 nodes can be ORed
  564.             together with  one gate.  This gate has a default delay of 1
  565.             time unit + 1 time unit per input driven.
  566.  
  567.                  Example: OR  3 1  2 5 15 will generate a high at node 3
  568.             if any of nodes 1, 2, 5, or 15 is high.
  569.  
  570.                 3.1.10 XNOR Gate
  571.  
  572.  
  573.                  Syntax: XNOR [output] [input] [input] [input] ...
  574.  
  575.                  This gate  XNORs together  all the input nodes and out-
  576.             puts that  value to  the output node.  Up to 32 nodes can be
  577.             XNORed together  with one gate.  This gate has a default de-
  578.             lay of 1 time unit + 1 time unit per input driven.
  579.  
  580.                  Example: XNOR 3 1 2 5 15 will generate a high at node 3
  581.             if the  value of node 3 exclusive-or the value of node 2 ex-
  582.             clusive-or the  value of  node 5  exclusive-or the  value of
  583.             node 15 is a logic low.
  584.  
  585.                 3.1.11 XOR Gate
  586.  
  587.  
  588.                  Syntax: XOR [output] [input] [input] [input] ...
  589.  
  590.                  This gate XORs together all the input nodes and outputs
  591.             that value  to the output node.  Up to 32 nodes can be XORed
  592.  
  593.  
  594.  
  595.                                        LOGSIM
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                                                                         8
  602.  
  603.  
  604.             together with  one gate.  This gate has a default delay of 1
  605.             time unit + 1 time unit per input driven.
  606.  
  607.                  Example: XOR  3 1 2 5 15 will generate a high at node 3
  608.             if the  value of node 3 exclusive-or the value of node 2 ex-
  609.             clusive-or the  value of  node 5  exclusive-or the  value of
  610.             node 15 is a logic high.
  611.  
  612.               3.2 Chips
  613.  
  614.  
  615.                  Syntax: [chip name] [pin assignments]
  616.  
  617.                  LOGSIM provides  a facility for adding new circuit ele-
  618.             ments--chip descriptors.   A  chip descriptor is a file that
  619.             describes the  function a  chip.   It can  also be used as a
  620.             macro facility  to simulate  large chunks  of circuitry.  If
  621.             LOGSIM does  not recognize an element as a gate, it searches
  622.             for a  file with  the same  name.   You can provide full DOS
  623.             paths as  your chip  name.   For example,  if your  chip  is
  624.             called "JK" in your circuit descriptor file, LOGSIM looks in
  625.             the current  directory of the current drive for a file named
  626.             JK.  If you called it "B:\logsim\chips\jk.dat", LOGSIM would
  627.             search for the file B:\LOGSIM\CHIPS\JK.DAT.
  628.  
  629.                  After the  name, the  pin assignments are listed.  This
  630.             is a  of what node each pin is tied to, starting with pin 1.
  631.             If you  had a  four pin chip named "4PIN" and pin 1 was tied
  632.             to node 4, pin 2 to node 3, pin 3 to a constant high and pin
  633.             4 to node 2, the line in the circuit descriptor would be:
  634.                                     4PIN 4 3 h 2
  635.  
  636.                  A chip can have up to sixty pins.
  637.  
  638.                  Several standard  chips are included in LOGSIM, all are
  639.             standard DIP packages.  They are described below:
  640.  
  641.                 3.2.1 D Chip Descriptor
  642.  
  643.  
  644.                  The D chip descriptor is identical to the 7476 chip de-
  645.             scriptor (see below).  It is included only for compatibility
  646.             with LOGSIM version 1.0.
  647.  
  648.                 3.2.2 JK Chip Descriptor
  649.  
  650.  
  651.                  The JK  chip descriptor  is identical to the 74112 chip
  652.             descriptor (see below).  It is included only for compatibil-
  653.             ity with LOGSIM version 1.0.
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                                        LOGSIM
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                                                                         9
  668.  
  669.  
  670.                 3.2.3 7476 Chip Descriptor
  671.  
  672.             The 7476 Chip Descriptor represents ½ of a 7476 chip, and is
  673.             a negative-edge triggered D flip flop with active-low preset
  674.             and clear.  The pin assignment is: (1) ~Preset; (2) D; (3)
  675.             Clock; (4) ~Clear; (5) Q; (6) ~Q
  676.  
  677.                                    Function Table
  678.                       Inputs             Outputs
  679.                       ~PRE  ~CLR  CLK D | Q ~Q
  680.                        L     L    X  X | H  H
  681.                         L     H    X  X | H  L
  682.                         H     L    X  X | L  H
  683.                         H     H    v  L | L  H
  684.                         H     H    v  H | H  L
  685.                         H     H    X  X | Q ~Q
  686.  
  687.                 3.2.4 74112 Chip Descriptor
  688.  
  689.  
  690.                  The 74112 Chip Descriptor is equivalent to ½ of a 74112
  691.             chip.   It represents a negative-edge-triggered JK flip-flop
  692.             with preset  and clear.   Both  preset and  clear are active
  693.             low.
  694.  
  695.                  Pin assignment:  (1) ~Preset;  (2) J; (3) Clock; (4) K;
  696.             (5) ~Clear; (6) Q; (7) ~Q
  697.  
  698.                            Function Table
  699.                  Inputs        Outputs
  700.                  ~PRE ~CLR CLK J K |  Q    ~Q
  701.                    L    L   X  X X |  H     H
  702.                    L    H   X  X X |  H     L
  703.                    H    L   X  X X |  L     H
  704.                    H    H   v  L L |  Q    ~Q       v indicates a
  705.                    H    H   v  L H |  L     H       falling edge
  706.                    H    H   v  H L |  H     L
  707.                    H    H   v  H H | ~Q     Q
  708.                    H    H   H  X X |  Q    ~Q
  709.  
  710.                 3.2.5 74123 Chip Descriptor
  711.  
  712.  
  713.                  The 74123 chip descriptor represents ½ of a 74123 chip.
  714.             Chip delays  are the  standard 1  + 1  time unit  per  input
  715.             driven.    Pins  1 and 2 are the A and B inputs of the chip,
  716.             pin 3  is clear,  and pins  4 and  5 are Q and ~Q.  A DELAYL
  717.             gate must  be connected  between pins  6 and 7 (pin 7 is the
  718.             output of  the DELAYL,  6 the  input to  the DELAYL).  Total
  719.             pulse duration  is equal to the delay of the DELAYL plus the
  720.             delay at  node 6  (driving one  output--the DELAYL) plus any
  721.             delay from the output of the DELAYL to the input of the one-
  722.             shot.   It is a 7-pin chip and is described by the following
  723.             table:
  724.  
  725.  
  726.  
  727.                                        LOGSIM
  728.  
  729.  
  730.  
  731.  
  732.  
  733.                                                                         10
  734.  
  735.  
  736.                       
  737.                       Input    Output
  738.                       1 2 3 7 | Q ~Q  6
  739.                       X X L X | L  H  L
  740.                       v H H X | H  L  H
  741.                       L ^ H X | H  L  H
  742.                       L H ^ X | H  L  H
  743.                       X X X v | 6 ~6  L
  744.                       X X X X | Q ~Q  L
  745.  
  746.                  Lines 2  through 4 of the table show the different ways
  747.             to trigger the one-shot.  In addition to the change of Q and
  748.             ~Q, a  low is outputted on pin 6.  The pulse continues until
  749.             the low in seen on pin 7 (delayed by the DELAYL, of course),
  750.             as shown by line 5.  The 6 and ~6 for Q and ~Q in line 5 are
  751.             to handle  the case  that the one-shot may have been retrig-
  752.             gered just  as pin  7 falls.  These equations force the one-
  753.             shot to trigger again.
  754.  
  755.                 3.2.6 74126 Chip Descriptor
  756.  
  757.  
  758.                  The 74126 chip descriptor represents ¼ of a 74126 chip.
  759.             This is  a three-state  buffer, where  pin 1 is the control,
  760.             pin 2  the input, and pin 3 the output.  Chip delays are the
  761.             standard 1  + 1  time unit  per input driven.  It can be de-
  762.             scribed as follows:
  763.                            
  764.                            Input | Output
  765.                              1 2 | 3
  766.                              L X | Z   (H in LOGSIM)
  767.                              H L | L
  768.                              H H | H
  769.  
  770.                 3.2.7 74192 Chip Descriptor
  771.  
  772.  
  773.                  The 74192  chip descriptor  represents a standard 74192
  774.             counter.   The pin  assignments are  exactly as  in the real
  775.             chip (including pin 8 for ground, and pin 16 for Vcc).  Pins
  776.             8 & 16 are don't cares--you can tie them to anything without
  777.             affecting the chip descriptor.
  778.  
  779.                 3.2.8 74193 Chip Descriptor
  780.  
  781.  
  782.                  The 74193  chip descriptor  represents a standard 74193
  783.             counter.   The pin  assignments are  exactly as  in the real
  784.             chip (including pin 8 for ground, and pin 16 for Vcc).  Pins
  785.             8 & 16 are don't cares--you can tie them to anything without
  786.             affecting the chip descriptor.
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.                                        LOGSIM
  794.  
  795.  
  796.  
  797.  
  798.  
  799.                                                                         11
  800.  
  801.  
  802.                 3.2.9 74253 Chip Descriptor
  803.  
  804.  
  805.                  The 74253  chip descriptor  represents ½  of a standard
  806.             74253 4-to-1  multiplexer.  It is an 8-pin chip and chip de-
  807.             lays are  the standard  1 +  1 time  unit per  input driven.
  808.             Pins 1  and 2  are the  select lines (pin 2 is most signifi-
  809.             cant), pin  3 is the active-low output control.  If pin 3 is
  810.             high, the  output is  forced high.  Pins 4 through 7 are the
  811.             inputs C0 through C3, and pin 8 is the output.  The function
  812.             can  be  described  by  the  equation:  8 = 3 + (4&~2&~1)  +
  813.             (5&~2&1) + (6&2&~1) + (7&2&1).
  814.  
  815.               3.3 Clocks
  816.  
  817.  
  818.                  Syntax: CLOCK [output] [pattern]
  819.  
  820.                  CLOCKS are inputs from the outside world.  They apply a
  821.             periodic pattern  to their  output pin.  The period is given
  822.             by the length of the pattern specified.  If you want node 21
  823.             driven by  a clock  with a 10 time unit period, of which the
  824.             first 3  are low and the last 7 are high, that would be rep-
  825.             resented by the line: CLOCK 21 0001111111.  Another example:
  826.             The line  CLOCK 1  1111001 represents a clock driving node 1
  827.             with a  period of  7, of  which the  first 4 and last 1 time
  828.             units are high and the 5th and 6th time units are low.
  829.  
  830.                  Long series  of 1's  and 0's  can be  compressed to the
  831.             forms "(repeat  * 1)"  and "(repeat * 0)" respectively.  For
  832.             example, the  line "CLOCK  21 0001111111"  can be  condensed
  833.             into "CLOCK 21 (3*0)(7*1)".  Note that only a single bit can
  834.             follow the  asterisk, trying to represent the pattern 010101
  835.             with (3*01) is wrong and WILL NOT WORK.
  836.  
  837.               3.4 Data Sources
  838.  
  839.  
  840.                  Syntax: DATA [output] [pattern]
  841.  
  842.                  DATA SOURCES  are inputs  from the outside world.  They
  843.             apply a  specified pattern  to their  output  pin.    Unlike
  844.             clocks, which  continuously repeat  their  pattern,  a  data
  845.             source remains  at its  last state when the pattern has been
  846.             exhausted.   For example,  the line  DATA 5  1001 is  a data
  847.             source driving  node 5  that starts  high, goes low for time
  848.             units 2 and 3, and then goes high for the rest of eternity.
  849.  
  850.                  Long series  of 1's  and 0's  can be  compressed to the
  851.             forms "(repeat  * 1)"  and "(repeat * 0)" respectively.  For
  852.             example, the line "DATA 21 0001111111" can be condensed into
  853.             "DATA 21 (3*0)(7*1)".   Note that only a single bit can fol-
  854.             low the  asterisk, trying  to represent  the pattern  010101
  855.             with (3*01) is wrong and WILL NOT WORK.
  856.  
  857.  
  858.  
  859.                                        LOGSIM
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                                                                         12
  866.  
  867.  
  868.             4. Simulating the Circuit
  869.  
  870.  
  871.                  Now that you've described your circuit, LOGSIM can sim-
  872.             ulate it.   By default, LOGSIM uses a constant one time unit
  873.             delay for  every output  (regardless of inputs driven), dis-
  874.             plays on the CRT, and goes for 100 time units.  By selecting
  875.             options, you  can change  these defaults to better suit your
  876.             needs.
  877.  
  878.               4.1 Simulation Time
  879.  
  880.  
  881.                  Syntax: TIME [end]
  882.                       OR
  883.                          TIME [start] [end]
  884.  
  885.                  The circuit  simulation can  last for  any number up to
  886.             32,767 time  units.  The default is 100 time units (based on
  887.             a screen width of 100) but this can be changed with the TIME
  888.             option.   If you change the screen width (with the WIDTH op-
  889.             tion), the  default simulation  time will also change to the
  890.             screen width.   The  number [end]  specified is  the time in
  891.             time units  to simulate.  For example, TIME 120 will run the
  892.             simulation for 120 time units.
  893.  
  894.                  If you  choose the second form (TIME [start] [end]) the
  895.             output from  the simulation  will only  be produced  for the
  896.             times between start and end.  For example, TIME 100 200 will
  897.             simulate the circuit for 200 time units, and the only output
  898.             that will  appear will  be that  between 100  and  200  time
  899.             units.
  900.  
  901.               4.2 Rise Time Calculations
  902.  
  903.  
  904.                  Syntax: RISE [n]
  905.                       OR
  906.                          RISE VARIABLE
  907.                       OR
  908.                          RISE FIXED
  909.  
  910.                  Output delays  can be  calculated in one of three meth-
  911.             ods.     Delays  can  be  constant  throughout  the  circuit
  912.             (exception: DELAY,  DELAYL and  DELAYH gates), or delays can
  913.             be a constant delay plus a certain amount per input the out-
  914.             put drives.   The constant delay and the increment per input
  915.             depends on what type of element is under consideration.  The
  916.             third method  just uses  the constant, element-dependant de-
  917.             lay.  These three methods can be expressed as:
  918.  
  919.                  1) Delay = n
  920.  
  921.  
  922.  
  923.  
  924.  
  925.                                        LOGSIM
  926.  
  927.  
  928.  
  929.  
  930.  
  931.                                                                         13
  932.  
  933.  
  934.                  2) Delay = f(element type) + v(element type) * # inputs
  935.                             driven by the output
  936.  
  937.                  or
  938.  
  939.                  3) Delay = f(element type)
  940.  
  941.                  By default,  LOGSIM uses the first form, with a uniform
  942.             1 time  unit delay  for all  elements.   You can change this
  943.             with the  RISE option.  The longest delay possible in LOGSIM
  944.             is 32,767 time units.
  945.  
  946.                  To select  a uniform  delay for  all  elements  (except
  947.             DELAY gates),  use the "RISE n" option.  For example, RISE 4
  948.             will set  the output  delay for  all elements  except  DELAY
  949.             gates to 4 time units.  This option overrides all delay for-
  950.             mulas, including those specified with the GATEDELAY option.
  951.  
  952.                  To select  the fixed + increment delay (#2, above), use
  953.             the RISE  VARIABLE option.   If  you are using the GATEDELAY
  954.             option, either  RISE VARIABLE or RISE FIXED is also required
  955.             before those numbers are utilized.
  956.  
  957.                  To select  fixed  delay  based  on  element  type  (#3,
  958.             above), use the RISE FIXED option.
  959.  
  960.               4.3 Gate Delays
  961.  
  962.  
  963.                  Syntax: GATEDELAY [fixed] [variable]
  964.  
  965.                  By default,  all gates in LOGSIM use a delay formula of
  966.             1 time  unit +  1 time unit per input driven.  The GATEDELAY
  967.             option is  used to  change the  numbers to  whatever is  re-
  968.             quired. The  formula is always [fixed] + [variable] * number
  969.             of inputs driven.  Example: GATEDELAY 2 0.1 changes the gate
  970.             delays to 2 time units + 0.1 time units per input driven.
  971.  
  972.                  Note that  unless you  use either  the RISE VARIABLE or
  973.             RISE FIXED option, GATEDELAY does not have any effect.
  974.  
  975.               4.4 Initial Conditions
  976.  
  977.  
  978.                  Syntax:   INITIAL   [1st   node's   value][2nd   node's
  979.                       value]...[last node's value]
  980.  
  981.                  This option  allows you to specify the initial state of
  982.             all the  nodes in  the circuit  (note: it  must be  ALL, not
  983.             some).   Simply list  the logic states (1 or 0) of each node
  984.             in ascending  order after  the word  INITIAL.   For example,
  985.             INITIAL 00001111  is an  8 node  circuit,  where  the  first
  986.             (lowest numbered) 4 start low and the last 4 high.
  987.  
  988.  
  989.  
  990.  
  991.                                        LOGSIM
  992.  
  993.  
  994.  
  995.  
  996.  
  997.                                                                         14
  998.  
  999.  
  1000.               4.5 Output Modes
  1001.  
  1002.  
  1003.                  LOGSIM can  output the results of its simulation in one
  1004.             of four ways: it can display on the CRT (the default), write
  1005.             to a file, print using graphics, or a quick-and-dirty print-
  1006.             out.  By using the DISPLAY, FILE, PRINT, and FPRINT options,
  1007.             the user  can select  which of these four methods.  Only one
  1008.             method can be used in any given simulation, so including two
  1009.             or more  of these option in your circuit descriptor file re-
  1010.             sults in only the last one taking effect.
  1011.  
  1012.                  To see  samples of  all four  output modes, execute the
  1013.             batch file OUTSAMPL.BAT.
  1014.  
  1015.                 4.5.1 Display
  1016.  
  1017.  
  1018.                  Syntax: DISPLAY
  1019.  
  1020.                  LOGSIM will  display the  timing diagram resulting from
  1021.             the simulation  on the  CRT.  If nodes are selected with the
  1022.             MONITOR option,  they will  be displayed,  otherwise the  20
  1023.             lowest numbered nodes will be shown.
  1024.  
  1025.                  LOGSIM can  fit 600 time units (default is only 100) on
  1026.             the screen,  and will  beep when the screen is full.  LOGSIM
  1027.             will then  wait until the user presses a key before display-
  1028.             ing the next screenfull.
  1029.  
  1030.                 4.5.2 File
  1031.  
  1032.  
  1033.                  Syntax: FILE [filename]
  1034.  
  1035.                  LOGSIM will  output the circuit timing to the specified
  1036.             file.  Every node in the circuit will be listed, even if the
  1037.             MONITOR option has been used.
  1038.  
  1039.                  A sample  of FILE  output, using  the circuit  0124, is
  1040.             shown below.
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.                                        LOGSIM
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                                                                         15
  1064.  
  1065.  
  1066.                       
  1067.                       
  1068.                                           Timing List
  1069.                       
  1070.                                       Nodes
  1071.                             000000000
  1072.                             000000000
  1073.                             000001111
  1074.                       Time  123453456
  1075.                       
  1076.                       1     001110001
  1077.                       2     011110001
  1078.                       3     011110001
  1079.                       4     011110001
  1080.                       5     111110001
  1081.                       6     111110001
  1082.                       7     111110001
  1083.                       8     011110001
  1084.                       9     011110000
  1085.                       10    011110010
  1086.                       11    011110010
  1087.                       12    111110010
  1088.                       13    111110010
  1089.                       14    111110010
  1090.                       15    011110010
  1091.                       16    011110011
  1092.                       17    011010101
  1093.                       18    011010101
  1094.                       19    111000101
  1095.                       20    111000101
  1096.                       21    111000101
  1097.                       22    011000101
  1098.                       23    011001101
  1099.                       24    010101001
  1100.                       25    010101001
  1101.  
  1102.                  The left-most  column is the time in time units.  Read-
  1103.             ing down  each column,  the top  is the node number (a four-
  1104.             digit number,  i.e. the  first node listed is 0001, the next
  1105.             0002, and  so on up to node 0016).  Below that, reading ver-
  1106.             tically in  each column,  is a  list of  the states for that
  1107.             node.   A '1'  indicates a logic high, and a '0' indicates a
  1108.             logic low.
  1109.  
  1110.                 4.5.3 Print
  1111.  
  1112.  
  1113.                  Syntax: PRINT
  1114.  
  1115.                  Use of this option requires that you had previously run
  1116.             the graphics  screen dump  program (GRAPHICS.COM  on PC-DOS,
  1117.             PSC.....COM on MS-DOS, see your DOS manual for more informa-
  1118.             tion).  The PRINT option is identical to the DISPLAY option,
  1119.             but at  the end of each screenfull, instead of the beep-and-
  1120.  
  1121.  
  1122.  
  1123.                                        LOGSIM
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.                                                                         16
  1130.  
  1131.  
  1132.             wait routine, LOGSIM copies the screen to the printer.  This
  1133.             takes time.
  1134.  
  1135.                 4.5.4 Fprint
  1136.  
  1137.  
  1138.                  FPRINT (which  stands for  Fast PRINT)  will print  the
  1139.             timing diagram  on the  printer in  the LPT1:  slot  (a.k.a.
  1140.             prn).   It is much faster than the PRINT option, but doesn't
  1141.             look as  nice.   FPRINT displays the nodes selected with the
  1142.             MONITOR option,  or the  twenty lowest numbered nodes if the
  1143.             MONITOR option is not used.
  1144.  
  1145.                  A sample  of FPRINT, from the 0124 sample circuit, look
  1146.             like:
  1147.                                                Timing List
  1148.                       
  1149.                                         Nodes
  1150.                        0   0    0    0
  1151.                        0   0    0    0
  1152.                        0   1    1    1
  1153.                        1   3    4    5
  1154.                       |   |    |    |
  1155.                       |   |    |    |
  1156.                       |   |    |    |
  1157.                       |   |    |    |
  1158.                        \  |    |    |
  1159.                         | |    |    |
  1160.                         | |    |    |
  1161.                        /  |    |    |
  1162.                       |   |    |    |
  1163.                       |   |    |     \
  1164.                       |   |    |      |
  1165.                        \  |    |      |
  1166.                         | |    |      |
  1167.                         | |    |      |
  1168.                        /  |    |      |
  1169.                       |   |    |      |
  1170.                       |   |     \    /
  1171.                       |   |      |  |
  1172.                        \  |      |  |
  1173.                         | |      |  |
  1174.                         | |      |  |
  1175.                        /  |      |  |
  1176.                       |    \     |  |
  1177.                       |     |   /   |
  1178.                       |     |  |    |
  1179.  
  1180.                  Again, read the node numbers vertically in each column.
  1181.             The timing  diagram makes  more sense if you rotate the page
  1182.             90 degrees  counter-clockwise.   Now, read  it like a normal
  1183.             timing diagram,  with time  increasing to  the right.  A '\'
  1184.             indicates a rising edge, and a '/' indicates a falling edge.
  1185.  
  1186.  
  1187.  
  1188.  
  1189.                                        LOGSIM
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.                                                                         17
  1196.  
  1197.  
  1198.               4.6 Time Units per Screen
  1199.  
  1200.  
  1201.                  Syntax: WIDTH [n]
  1202.  
  1203.                  By default,  LOGSIM displays  100 time units per screen
  1204.             (or page)  in the  DISPLAY and  PRINT output modes.  You can
  1205.             alter this  to anywhere  between 10  and 600  time units per
  1206.             screen with  the WIDTH  option.   Example: WIDTH 300 display
  1207.             300 time  units per screen (300 per page in PRINT mode).  If
  1208.             the TIME  option is  not used,  and the WIDTH option is, the
  1209.             simulation time will default to the screen width.
  1210.  
  1211.               4.7 Monitoring nodes
  1212.  
  1213.  
  1214.                  Syntax: MONITOR [node] [node] [node] ...
  1215.  
  1216.                  MONITOR is  used in conjunction with the DISPLAY, PRINT
  1217.             and FPRINT  options to select which nodes to display.  Up to
  1218.             twenty nodes  can be  selected in  any one  simulation.  The
  1219.             nodes will  be displayed  in the order that you list them in
  1220.             the MONITOR option, and you can repeat nodes if you wish.
  1221.  
  1222.                  Example: to display nodes 1, 3, 13, 14, 15, and 20, use
  1223.             MONITOR 1 3 13 14 15 20.
  1224.  
  1225.               4.8 Fanout Lists
  1226.  
  1227.  
  1228.                  Syntax: FANOUT
  1229.                       OR
  1230.                          FANOUT [file]
  1231.  
  1232.                  LOGSIM can count the number of inputs that each node is
  1233.             driving.   The FANOUT option will have LOGSIM display a list
  1234.             of how  many inputs  each node  is driving.  By default, the
  1235.             FANOUT list  appears on  the CRT,  but using the second form
  1236.             (FANOUT [file]) lets  you send  the output to a file of your
  1237.             choice.   For example, FANOUT CKT3FAN writes the fanout list
  1238.             to the file CKT3FAN.
  1239.  
  1240.             5. Chip Descriptions
  1241.  
  1242.  
  1243.                  The hardest  and most  useful (isn't  that  always  the
  1244.             case) part  of LOGSIM  lies in  its expandability.  Only the
  1245.             gates described  above are  built in  to the LOGSIM program.
  1246.             All other chips are included in chip descriptor files.  Yes,
  1247.             you can write you own chip descriptors, and now I'm going to
  1248.             tell you how.
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.                                        LOGSIM
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                                                                         18
  1262.  
  1263.  
  1264.               5.1 Making New Chips
  1265.  
  1266.  
  1267.                  To implement  a new  chip (or  macro), you must write a
  1268.             new chip  descriptor.   A chip  descriptor consists  of 4 or
  1269.             more lines  that functionally  describe the chip.  The first
  1270.             three lines  of a  chip descriptor state the number of pins,
  1271.             fixed and variable delay, the mode select pins, and the out-
  1272.             put pins.   The  remaining lines  contain equations  for the
  1273.             output pins conditions for the mode pins and  in that mode.
  1274.  
  1275.                 5.1.1 Pins, Delay, Mode and Output Pins
  1276.  
  1277.  
  1278.                  The first  line contains  three numbers:  the number of
  1279.             pins on  this chip,  the fixed delay increment and the delay
  1280.             increment.   Pins on a chip are numbered sequentially start-
  1281.             ing with 1.
  1282.  
  1283.                  The fixed  delay [  f(element) ]  and  delay  increment
  1284.             [ v(element) ] are used in computing rise times for the out-
  1285.             puts.  See the section on Rise Time Calculations.
  1286.  
  1287.                  The fixed  delay must  be an  integral number  of  time
  1288.             units, but  the variable  delay can can be in fractions of a
  1289.             time unit (e.g. 0.25)
  1290.  
  1291.                  The second line,  lists the Mode Select Pins.  Mode se-
  1292.             lect pins  are used to distinguish between several different
  1293.             behaviors of the chip.  For example, in the JK chip descrip-
  1294.             tor, pins  1, 3,  and 5  are mode  select pins--the ~PRESET,
  1295.             CLOCK, and  ~CLEAR  pins.  A JK flip flop's behavior is dif-
  1296.             ferent depending  on the  states of  the CLEAR,  PRESET, and
  1297.             CLOCK lines.
  1298.  
  1299.                  Mode select  pins are  included for convenience, as the
  1300.             JK chip descriptor could be re-written to use only the CLOCK
  1301.             pin as a mode select pin
  1302.  
  1303.                  Mode select  pins MUST  be used  for any edge-triggered
  1304.             inputs.
  1305.  
  1306.                  Every chip  descriptor MUST  have at least one mode se-
  1307.             lect pin!
  1308.  
  1309.                  The third line lists the output pins for this chip.  An
  1310.             output pin  is a pin whose state is determined by this chip.
  1311.             The output  delay associated with a chip applies between the
  1312.             output pin  and the  outside world.  For use within the same
  1313.             chip, there  is only a one time unit delay.  For example, in
  1314.             the JK  chip descriptor,  if the mode select pins fall under
  1315.             the HXH  state and  there is a 5 time unit delay.  The newly
  1316.             determined state for pins 6 and 7 appear 5 time units later,
  1317.             but they are usable in the chip itself one time unit later.
  1318.  
  1319.  
  1320.  
  1321.                                        LOGSIM
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.                                                                         19
  1328.  
  1329.  
  1330.                 5.1.2 Chip Modes
  1331.  
  1332.  
  1333.                  Chip modes can be thought of as behavior patterns.  For
  1334.             example, a  74193 counter  can either be holding the present
  1335.             count, loading  a new  count with  the LOAD pin, clearing to
  1336.             zero with  the CLEAR pin, counting up, or counting down.  By
  1337.             implementing each  of those cases as patterns of mode select
  1338.             pins, the  equations are  simpler and more intuitively obvi-
  1339.             ous.
  1340.  
  1341.                  In order  to implement edge-triggered devices (example:
  1342.             the JK  flip flop,  on which  the clock pin is negative-edge
  1343.             triggered), you will have to include the edge-triggered pins
  1344.             among your mode select pins.
  1345.  
  1346.                 5.1.3 Output Equations
  1347.  
  1348.  
  1349.                  The fourth and following lines of a chip descriptor de-
  1350.             scribe contain  equations describing  the  chip's  function.
  1351.             Each line  consists of  a mode  select pattern, a colon (:),
  1352.             the equations  for the  output pins in that mode.  The equa-
  1353.             tions follow  the colon  and are  separated by  commas.  THe
  1354.             equations determine the states of the output pins--the first
  1355.             equation goes with the first output pin, the second with the
  1356.             second, etc.
  1357.  
  1358.                  The mode  select pattern  is a description of the state
  1359.             of the  mode select pins.  To represent this, LOGSIM uses an
  1360.             H to  represent a  logic high  state, an  L for low, a X for
  1361.             don't-care, a  v for  a falling  edge, and  a ^ for a rising
  1362.             edge.   In the  JK chip descriptor, the mode select pins are
  1363.             1, 3,  and 5.  The mode select pattern "HVH" means that node
  1364.             1 is  high, there is a falling edge on node 3, and node 5 is
  1365.             high.
  1366.  
  1367.                  LOGSIM examines  each mode  select pattern in the order
  1368.             they are  listed.   The equations  associated with the first
  1369.             one mode select pattern that applies are used.
  1370.  
  1371.                  Examples:  Using the JK chip descriptor (see below), if
  1372.             the current  states of  pins 1, 3, and 5 are high, low, low,
  1373.             then the  equations on the sixth line (with the HXL pattern)
  1374.             are used: pin 6 goes low and pin 7 goes high.
  1375.  
  1376.                  If nodes  1 and 5 remain high while node 3 changes from
  1377.             a high  to low state, the seventh line (HvH) applies.  These
  1378.             equations calculate  the new  state for the Q and ~Q outputs
  1379.             according to the standard JK truth table.
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.                                        LOGSIM
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.                                                                         20
  1394.  
  1395.  
  1396.               5.2 Sample Chip Descriptions
  1397.  
  1398.                                The JK Chip Descriptor
  1399.  
  1400.                  This is a small chip descriptor that illustrates all of
  1401.             the design  topics discussed above.  Examining this chip de-
  1402.             scriptor should dispel any questions about the chip descrip-
  1403.             tor format.  The chip descriptor file is:
  1404.                       7 1 1
  1405.                       1 3 5
  1406.                       6 7
  1407.                       LxL: H, H
  1408.                       LxH: H, L
  1409.                       HxL: L, H
  1410.                       HvH: (6 & ~4) + (7 & 2), ~( (6 & ~4) + (7 & 2) )
  1411.                       HxH: ~7, ~6
  1412.  
  1413.                  It is a seven pin chip, with a delay of 1 time unit + 1
  1414.             per input  driven (7 1 1).  Pins 1, 3 and 5 are the mode se-
  1415.             lect pins (1 3 5), and pins 6 and 7 are the outputs (6 7).
  1416.  
  1417.                  The equations  show that  both outputs  (Q and  ~Q) are
  1418.             high when  pins 1  and 3 (~PRESET and ~CLEAR) are low.  Else
  1419.             if pin  1 is  low and  pin 5  is high (presetting), pin 6 is
  1420.             high and  pin 7  is low.  Else if pin 1 is high and pin 5 is
  1421.             low (clearing),  pin 6  is low and 7 is high. Else if pins 1
  1422.             and 5  are high while there is a falling edge on pin 3, pins
  1423.             6 and  7 follow  the standard  JK rules  (check them--you'll
  1424.             see).   Finally, if  pins 1 and 5 are high, pins 6 and 7 are
  1425.             inverses of each other ( Q = ~ (~Q) and ~Q = ~(Q) ).
  1426.  
  1427.               5.3 Simulating ROMS
  1428.  
  1429.  
  1430.                  ROMs are  easy to simulate.  Just use the address lines
  1431.             as the  mode select  lines and  express the output directly.
  1432.             For example,  an imaginary  4-word, 4-bit  ROM with contents
  1433.             0001, 0010,  0100, and  1111 in addresses 0, 1, 2, and 3 re-
  1434.             spectively.   Pins 1  through 2  are the address inputs, and
  1435.             pins 3  through 6  are the  data outputs,  delays are 4 time
  1436.             units plus  .25 time  units per  input driven.  This can  be
  1437.             coded as:
  1438.  
  1439.                       6 4 .25
  1440.                       1 2 3 4
  1441.                       5 6 7 8
  1442.                       LL:L,L,L,H
  1443.                       LH:L,L,H,L
  1444.                       HL:L,H,L,L
  1445.                       HH:H,H,H,H
  1446.  
  1447.                  Of course,  if you  can reduce the number of equations,
  1448.             you will only improve LOGSIM's performance.
  1449.  
  1450.  
  1451.  
  1452.  
  1453.                                        LOGSIM
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.                                                                         21
  1460.  
  1461.  
  1462.               5.4 Simulating RAMS
  1463.  
  1464.  
  1465.                  Good Luck!   RAMs  have to be represented as a group of
  1466.             flip-flops with  address decoding  and output  selection--in
  1467.             other words, you'll have to build every memory cell by hand.
  1468.             This is one item that will be changed in the future.
  1469.  
  1470.               5.5 Simulating PALs and PLAs
  1471.  
  1472.  
  1473.                  This is  easier than  a ROM,  just write  the equations
  1474.             down and  you're done.   For  example,  consider  a  4-input
  1475.             (called A,  B, C,  and D),  4-output (called W, X, Y, and Z)
  1476.             PAL       which        implements       the       equations:
  1477.             W = A+B; X = W*~D; Y = A&B&C&D; Z = ~(A*B) + ~(C&D).   We'll
  1478.             use pins  1 through  4 for  A through D and pins 5 through 8
  1479.             for pins W through Z.  Since there is no obvious mode select
  1480.             pin, we'll choose pin 1.  Use a standard 1 time unit + 1 per
  1481.             input driven delay, and we get:
  1482.  
  1483.                       8 1 1
  1484.                       1
  1485.                       5 6 7 8
  1486.                       X: 1+2, 5*~4, 1&2&3&4, ~(1&2) + ~(3&4)
  1487.  
  1488.                  By using pin 1 as a mode select and using the pattern X
  1489.             (don't-care), we  meet LOGSIM's requirement for at least one
  1490.             mode select pin and we don't obscure the equations.
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.                                        LOGSIM
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.                                                                         A
  1526.  
  1527.  
  1528.                                        Index
  1529.             
  1530.             Chip descriptor, 8, 17
  1531.             Circuit descriptor, 2
  1532.             
  1533.             END statement, 2
  1534.             
  1535.             GRAPHICS.COM, 1
  1536.             
  1537.             Macro facility
  1538.               see Chip descriptor
  1539.             
  1540.             Output delays, 12
  1541.             
  1542.             Pin assignments, 8
  1543.             Precedence, 3
  1544.             PSCxxxx.COM, 1
  1545.             
  1546.             Special nodes, 3
  1547.             
  1548.             Time unit, 1
  1549.             
  1550.             Wired-ANDed, 3
  1551.             
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.                                        LOGSIM
  1586.  
  1587.  
  1588.