home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s205 / 1.ddi / BACKUP.001 / DOC_IREF_MACH_EX.HLP < prev    next >
Encoding:
Text File  |  1991-03-11  |  23.0 KB  |  521 lines

  1. ======================================================================
  2. MACH Design Examples
  3. ----------------------------------------------------------------------
  4.  
  5.  
  6.  
  7.  
  8. ************************* Disclaimer *********************************
  9. Note: The following applications examples are provided solely for the
  10. purposes of learning the MACH architecture and software. No implicit
  11. guarantee of functionality or usability for any other purpose is
  12. represented.
  13. **********************************************************************
  14.  
  15.  
  16.  
  17. Overview
  18.        This section of the documentation provides several application
  19.        "shorts" to guide the beginning MACH user in learning the MACH
  20.        device. They also serve to instruct designers in alternate methods of
  21.        implementing useful structures.
  22.        
  23.        Each shows "clever and significant" design use of the device
  24.        resources. The logic in these files  may be described further in
  25.        applications notes, exploring their significance. These test cases
  26.        explore processing options, resource limits, simulation support, etc.
  27.  
  28.  
  29.  
  30.  
  31.  
  32. Counters:
  33. ------------------------
  34.  
  35. CNT_SMPL.SCH    device=MACH110
  36.         16-bit up/down Counter with preload -- created with 74192 macros.
  37.         Shows "brute force" approach to counter. Explanation of connection
  38.         problems demonstrated.
  39.  
  40. CNT_16B.SCH     device=MACH110
  41.         Better implementation of 16-bit counter, built with 74163 macros.
  42.  
  43. AMD_C16.110   device=MACH110
  44.         16-bit up/down Counter with preload -- Vector PDS format. Shows use
  45.         of byte-carry to minimize number of inputs that have to communicate
  46.         between blocks.
  47.  
  48. CNT_31.PDS    device=MACH110
  49.         31-bit up/down Counter with simulation
  50.  
  51. Data Routing Functions:
  52. ------------------------
  53.  
  54. AMD_CM8.110   device=MACH110
  55.         Dual 8-bit data multiplexing function -- Preloadable Up/down counter
  56.         feeding a 2:1 mux taking its input from counter outputs & pre-load
  57.         data inputs. Extreme utilization of all device resources. Requires
  58.         use of FITR expand & Full flags.
  59.  
  60. BRL_SHFT.PDS    device=MACH110
  61.         8-bit Barrel Shifter - Shows need to spaceout large functions
  62.         to allow sourcing of global inputs and use of feedback.
  63.  
  64. Arithmetic Functions:
  65. ------------------------
  66.  
  67. ADD_11B.PDS     device=MACH110
  68.         11-bit Adder
  69.  
  70. ADD_4B.PDS      device=MACH110
  71.         4-bit Adder
  72.  
  73. ADD_8B.PDS      device=MACH110
  74.         8-bit Adder
  75.  
  76.  
  77.  
  78.  
  79.  
  80. Miscellaneous Functions:
  81. ------------------------
  82.  
  83. ORCADDMA.SCH    device=MACH110
  84.         Design example used in the documentation tutorial shows how to
  85.         design for a MACH110 using the OrCAD/SDT III editor.
  86.  
  87.  
  88. A_TO_D.sch      device=MACH110
  89.         Successive approximation register for a analogue to digital
  90.         converter system with simulation.
  91.  
  92. M7SEG1.PDS      device=MACH110
  93.         7 Segment counter plus decoder with simulation.
  94.  
  95.  
  96. SRAM1.PDS       device=MACH110
  97.         Simple state machine for controls of static RAM - from 29K handbook.
  98.  
  99. DRAM.PDS       device=MACH210
  100.         Integration of 2 inter-linked state machines (originally 23S8
  101.         designs) from pg 2-187 of the PAL Handbook.
  102.  
  103. RLLENDEC.PDS    device=MACH210
  104.         Integration of Codec functions
  105.  
  106.  
  107.  
  108.  
  109.  
  110. Pre-Loadable U/D N-bit Counter
  111. Purpose
  112.        These examples show how to implement wide counters within MACH
  113.        architecture. They guide the user through some of the elementary
  114.        pitfalls and illustrate use of the FITR command line options for
  115.        successful fitting.
  116.  
  117.        Large counters represent an important and useful application for
  118.        PLD's. It is also one of the most common means of "benchmarking" what
  119.        a PLD architecture can do. The ability to create wide product terms
  120.        across many flip-flops measures the global signal access of the part.
  121.        Speed of operation and logic utilization is easy to evaluate because
  122.        of the regular structure and the ease of extrapolation to larger size
  123.        devices and counters.
  124.  
  125. Logic Implementation
  126. Type of Flip-flop
  127.        Counters can be implemented in a variety of  ways. We are most
  128.        interested in those that count in a binary sequence (000, 001, 010,
  129.        ...) and operate synchronously. If implemented with only D-type
  130.        flip-flops, wider OR structures are needed for each successive bit
  131.        added to the width of the counter. For large counters (10-12 bits),
  132.        this product term growth overcomes most fixed product term
  133.        allocations. After this point, some sort of flip-flop banking is
  134.        required and enabling of the clock source is commonly utilized.
  135.  
  136.        A Toggle flip-flop is much more efficient for implementing  large
  137.        counters. Only one product term (2 total for UP and down) per stage
  138.        is needed to tell each T-FF to complement. Whenever all bits lower
  139.        than its stage are "ones", the flip-flop changes state for counting
  140.        up --  likewise all "zeroes" triggers counting down. At each stage,
  141.        only the width of the AND gates change, encompassing more stages in
  142.        the all "ones" determination.
  143.  
  144. Carry Generation
  145.        Carrys can be pipelined when the device  block size limits access to
  146.        counter stages. Creation of large AND gates are limited in most
  147.        segmented PLD architectures -- there is a certain "granularity" that
  148.        allows N input functions, but no more. For larger functions, a tree
  149.        or chain of elements must be created, usually implying additional
  150.        delay for logic propagation.
  151.  
  152. Pre-decoding
  153.        This would seem to limit the maximum frequency of operation,  but the
  154.        pre-calculation of these AND terms may be accomplished and a spare
  155.        macrocell (flip-flop) can store the partial term. In the next stage
  156.        the completed AND term can be formed, to cause a given stage to
  157.        count. In this way, modular PLD architectures can feed partial terms
  158.        to where they are needed for later stages of the counter. The counter
  159.        will then operate at the maximum allowed by a single stage of logic
  160.        propagation.
  161.        
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. ----------------------------------------------------------------------------
  170. Example Files
  171.        Different implementations of counters are demonstrated in 
  172.        these files:
  173.  
  174. Cnt16_Smpl.Sch
  175.        16-bit up/down Counter with preload -- created with 74192 
  176.        macros. Shows "brute force" approach to counter. Explanation 
  177.        of connection problems demonstrated.
  178.  
  179. Cnt_16b.Sch
  180.        Better implementation of 16-bit counter, built with 74163 macros.
  181.  
  182. Cnt_16V.pds
  183.        16-bit up/down Counter with preload -- Vector PDS format. 
  184.        Shows use of byte-carry to minimize number of inputs that have 
  185.        to communicate between blocks.
  186.  
  187. Cnt_31b.pds
  188.        A maximal length (31-bit) counter for the 
  189.        MACH110.
  190.  
  191. Cnt_16s.pds
  192.        AND/OR equation version of Cnt_16UDV used for 
  193.        size limit testing (Cnt_16r.pds is also on disk).
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. ----------------------------------------------------------------------------
  202. Detailed Discussion
  203.  
  204. Cnt16_Smpl.Sch
  205.        Cnt16_Smpl illustrates the "brute force" approach to building a
  206.        16-bit up/down. Entering the design using OrCAD's Draft program takes
  207.        only a few minutes to place the 74192 4-bit counter macros and to
  208.        interconnect the Carry and Borrow terms. No Connect (NC) flags are
  209.        placed on the carry and borrow out signals from the highest counter
  210.        stage.
  211.        
  212.        When run through the MACH software, we can see a reasonable  set of
  213.        resources are used (for the MACH110).
  214.  
  215.               Available    Used   Remaining
  216.        Clocks:      2        1          1
  217.          Pins:     38       37          1      97%
  218.        IO_Mac:     32       16         16
  219.   Total macro:     32       16         16
  220. Product terms:    128       80         16      62%
  221.         
  222.        MACH-PLD Resource Checks OK! - Utilization *: 69 % The difficulty
  223.        occurs when we get to block partitioning. We see here that all of the
  224.        block inputs are used by placing only a few counter stages into each
  225.        block. The remaining stages do not fit and remain "unplaced".
  226.  
  227. FITR Flags
  228.        This testcase was run with the FULL flag on -- with it off,  the
  229.        design would have failed similarly, but with only 1 equation in each
  230.        block.
  231.  
  232.        Error F580 announces the problem  -- signals unplaced. Warning  F120
  233.        indicates the block partitioning measure is too high (everything is
  234.        connected to everything -- contributory factor).
  235.        
  236.  
  237.        What has happened is  that  all stages of combinatorial logic along
  238.        the carry / borrow path have been merged together, increasing the
  239.        number of inputs required at the upper stages. The logic is
  240.        relatively simple for this design, but very wide gating.
  241.        
  242.        Superficially, there is no simple solution to the simple 16- bit
  243.        counter presented here. The design as drawn needs larger PLD blocks
  244.        (more inputs) than is available on the MACH. The only solution is to
  245.        drain the swamp -- change the design to require fewer inputs on the
  246.        higher stages.
  247.        
  248. ----------------------------------------------------------------------------
  249. Cnt16_Btr.Sch
  250.        Cnt16_Btr demonstrates the technique of redoing the logic to  limit
  251.        the number of inputs to the logic driving the upper stages. This time
  252.        the 16-bit counter is built with 74163 macros and only counts up.
  253.        
  254.        Each of the 8-bit  counter stages employs standard logic for
  255.        connecting the ripple carry output (RCO) to the count enable (ENP)
  256.        within the block.
  257.  
  258. Carry Implementation
  259.        Carry between 8-bit blocks is constructed as a 7-bit  AND gate
  260.        (decoding 1111.111x). A Node flag is placed on its output to force
  261.        the software to generate a separate equation for this logic, instead
  262.        of merging with other stages. This will require an additional
  263.        propagation delay, but since the lowest bit is not included, there is
  264.        extra time for this logic.
  265.        
  266.        The lowest bit of the counter (C0) in not included in this  carry,
  267.        but instead is coupled to all the upper stages of the counter. This
  268.        is done as an alternate to carry pipelining -- each counter bit can
  269.        "see" the LSB and make its own decision on counting, preserving the
  270.        full speed operation of the device.
  271.        
  272. FITR Flags
  273.        This example will be successfully fitted with no flags on.
  274.  
  275. Logic Hazard
  276.        This method of carry logic implemention comes with a slight  problem
  277.        -- what happens when the counter is preloaded to 1111.1111.1111.1111.
  278.        Does it "roll-over" on the next clock cycle, if it is enabled to
  279.        count? No -- because the carry does not have time to settle and thus
  280.        won't be valid. This "minor" glitch is one reason this sort of logic
  281.        change can't be automated to happen transparently to the user, but
  282.        must be designed in manually.
  283.        
  284. ----------------------------------------------------------------------------
  285. Cnt_16V.pds
  286.        This file shows the same technique of input reduction applied  to an
  287.        16-bit up/down counter.  The design file is written using vectored
  288.        signal equations -- this significantly compacts the design file.
  289.        
  290. Carry / Borrow
  291.        For this design, both Carry and Borrow need to be implemented  to
  292.        allow up and down count modes. Since each stage has access to the
  293.        count enable and the counting mode (UP), the carry and borrow logic
  294.        may be combined into one macrocell.
  295.        
  296.        Two product terms are used to detect the all "ones" and all  "zeros"
  297.        conditions of the 7 bits as before (1111.111x and 0000.000x). This
  298.        combined signal is then fed to each of the upper count stages and
  299.        decoded to give the correct counter operation.
  300.        
  301. FITR Flags
  302.        This example is routed successfully using the Expand flag. If  this
  303.        is not done, it fails with 2 inputs incompletely routed.
  304.        
  305.        The block partitioning display indicates that each byte of the
  306.        counter is placed into "natural" divisions and that the switch matrix
  307.        is "heavily" utilized (90% _ 69%). Significant user additions to the
  308.        functionality may jeopardize this fitting success.
  309.  
  310. ----------------------------------------------------------------------------
  311. Data Routing Functions
  312. Purpose
  313.        Show how the I/O macro-rich architecture of the MACH  implements data
  314.        routing functions. Introduce some resource- planning considerations
  315.        of dealing with the connection-dense routing functions.
  316.        
  317.        Data routing functions are a classic area for PLD  applications. With
  318.        the byte-wide paths and product term-clumps allocated to specific I/O
  319.        ports, the MACH devices are ideally suited for many functions. We
  320.        offer a modest selection of some particularly useful configurations.
  321.        
  322. ----------------------------------------------------------------------------
  323. Example Files
  324. Cnt_Mux8.pds
  325.        Dual 8-bit data multiplexing function -- Preloadable Up/down  counter
  326.        feeding a 2:1 mux taking its input from counter outputs and pre-load
  327.        data inputs. Extreme utilization of all device resources (91%).
  328.        Requires use of FITR expand & Full flags.
  329.  
  330. Brl_Shft.pds
  331.        8-bit Barrel Shifter - Shows need to spaceout large functions  to
  332.        allow sourcing of global inputs and use of feedback.
  333.        
  334.  
  335. ----------------------------------------------------------------------------
  336. Detailed Discussion
  337. Cnt_Mux8.pds
  338.        Dual 8-bit data multiplexing function -- Preloadable Up/down  counter
  339.        feeding a 2:1 mux taking its input from counter outputs & pre-load
  340.        data inputs. Extreme utliization of all device resources (91%).
  341.        Requires use of FITR expand & Full flags.
  342.        
  343.        *** Device Resource Checks
  344.               Available    Used   Remaining
  345.        Clocks:      2        1          1
  346.          Pins:     38       37          1      97%
  347.        IO_Mac:     32       16         16
  348.  Total macros:     32       32          0
  349. Product terms:    128       94          0      72%
  350.         
  351.        MACH-PLD Resource Checks OK! - Utilization *: 90 %
  352.        ...
  353.        
  354.  
  355. ----------------------------------------------------------------------------
  356. 8-bit Barrel Shifter
  357.        Shows need to space out large AND/OR functions  to allow sourcing of
  358.        global inputs and use of feedback.
  359.  
  360.        *** Device Resource Checks
  361.               Available    Used   Remaining
  362.        Clocks:       2        1        1
  363.          Pins:      38       22       16      57%
  364.        IO_Mac:      32        8       24
  365.  Total macros:      32        8       24
  366.           PTs:     128       80       32      62%
  367.        
  368.        MACH-PLD Resource Checks OK! - Utilization *: 47 %
  369.        
  370.        ...
  371.  
  372. ----------------------------------------------------------------------------
  373. Arithmetic Functions
  374. Purpose
  375.        Demonstrate new ways of realizing arithmetic functions using  MACH
  376.        devices. Show how the functional implementation can be structured
  377.        around the device architecture and the advantages that result.
  378.        
  379.        Simple arithmetic functions form an important area of system
  380.        building blocks unaddressed by conventional PLD's. New high density
  381.        PLD architectures redo the balance sheet, opening up new application
  382.        areas. Designer creativity is the key ingredient to satisfying these
  383.        opportunities.
  384.        
  385. ----------------------------------------------------------------------------
  386. Parallel Adder Design Considerations
  387.        A basic 4-bit adder can be constructed by cascading 4 single bit full
  388.        adders. The problem with this approach is that the delays associated
  389.        with the carry are additive. In the case of a 4-bit adder this means
  390.        4 delays (60nS in a 15nS MACH device) before the final result is
  391.        obtained. This approach, using a MACH device yields a design that
  392.        takes 8 macros and yields a result in 60nS. This is good from a macro
  393.        usage viewpoint but takes too much time.
  394.        
  395.        For later comparison purposes this adder design was expanded  to fill
  396.        as much of a MACH110 as possible. The first trial (12 bits) would be
  397.        satifactory for the number of macros (24), but would require too many
  398.        array inputs (36). An 11-bit adder using this approach was
  399.        successfully routed using the Expand Product Term option on the
  400.        compilier.  Again this design is very efficient but causes problems
  401.        in the area of speed (165nS).
  402.  
  403. Flores Sum & Carry
  404.        A classic way of designing fast adders was described in the  1960s by
  405.        Flores in his "The Logic of Computer Arithmetic". He describes a look
  406.        ahead carry method where independent sum and carry terms are
  407.        generated for each bit and these are used to generate the full carry
  408.        terms. Using the intermediate sum and the full carry the final sum
  409.        bits are generated. With lots of gates with very wide inputs it is
  410.        possible to generate an adder of any length in 3 gate delays.
  411.        Examination of the schematic for the 7483 in TI's 'yellow book' shows
  412.        a 4-bit adder constructed using this "LookAhead Carry" methodology.
  413.        
  414.        The problem that exists with this approach in the MACH family  is one
  415.        of inputs to the array. On a 4-bit adder this approach takes 20 array
  416.        inputs while using 19 macrocells. We could reduce this somewhat by
  417.        combining the G equations into the C equations, resulting in 4 less
  418.        macrocells and array inputs. For both implementations of Flores's
  419.        adders, the sums are generated in 45nS and the carry in 30nS. At 15
  420.        macrocells and that speed, this approach may be a good compromise
  421.        over the ripple carry approach. If this approach is extended to fill
  422.        a MACH110, the results are a maximum of 7 bits using 25 macrocells
  423.        with the sum in 45nS and the carry in 30nS.
  424.        
  425. ----------------------------------------------------------------------------
  426. Logic Implementation
  427. Another Approach
  428.        One needs to step back in methodology to generate an even more
  429.        efficient solution. Instead of using look ahead carry methods try a
  430.        brute force method. Let's make a 2 bit adder by writing the direct
  431.        equations without using intermediate nodes and put 2 of these
  432.        together. This results in a 2 bit adder with 1 delay and 6 macrocells
  433.        used.
  434.        
  435.        If 2 of these are stacked together we have our 4-bit adder using 12
  436.        macrocells instead of 15 in the LookAhead Carry version and producing
  437.        a result in 2 delays rather than 3. Further it uses only 10 array
  438.        inputs as opposed to 16. Expanding this method to the limits of a
  439.        MACH110 produces an 11-bit adder (at 12 bits we run out of product
  440.        terms).  This design operates at 90nS for both sums and carry.
  441.        
  442.  
  443. Refinements
  444.        The final trial will be to apply "LookAhead  Carry" techniques to the
  445.        2-bit chunk implementation. Using full "LookAhead" accross all 8 bits
  446.        didn't work, but if the last 2 bits are implemented as a simple 2
  447.        bit adder, the MACH110 fits 8 bits and produces a sum and carry
  448.        result in 45nS.
  449.        
  450. ----------------------------------------------------------------------------
  451. Summary Guidelines
  452.  
  453.        Remember that array inputs are golden and excellent results  can be
  454.        obtained by restructuring logic considering that fact.
  455.        
  456.        RULE : It is best to expand product terms up to the maximum
  457.        supported by the part if you want to save delay time and/or array
  458.        inputs.
  459.        
  460. Macro Usage for Adders
  461.        Number of bits    4       6       7       8       9      10      11
  462.        ---------------------------------------------------------------------
  463.         Ripple Carry     8      12      14      16      18      20      22
  464.         LookAhead Carry 15      21      25              Cant' Do
  465.         2 Bit Chunks    12      18      20      24      26      30      32
  466.         2 Bit with Look 10      15      17      21      Can't Do
  467.        
  468. Sum Delay Times for Adders (ns for MACH110-15)
  469.        Number of bits    4       6       7       8       9      10      11
  470.        ---------------------------------------------------------------------
  471.         Ripple Carry    60      90      105     120    135     150     165
  472.         LookAhead Carry 45      45       45             Can't Do
  473.         2 Bit Chunks    30      45       60      60     75      75      90
  474.         2 Bit with Look 45      45       45      45     Can't Do
  475.        
  476. Carry Delay Times for Adders (ns for MACH110-15)
  477.        ---------------------------------------------------------------------
  478.         number of bits   4       6       7       8       9       10      11
  479.         Ripple Carry    60      90      105     120     135     150     165
  480.         LookAhead Carry 30      30       30              Can't Do
  481.         2 Bit Chunks    30      45       60      60      75      75      90
  482.         2 Bit with Look 30      30       45      45      Can't Do
  483.        
  484.  
  485. ----------------------------------------------------------------------------
  486. Example Files
  487.        ADD_11B.pds - 11-bit adder using Ripple Carry
  488.        
  489.        ADD_4B.pds - 4-bit adder using 2 Bit Chunks & Look-ahead
  490.        Carry
  491.        
  492.        ADD_8B.pds -8 bit adder using 2 Bit Chunks & Look-ahead 
  493.        Carry
  494.        
  495. ----------------------------------------------------------------------------
  496. Additional Discussion
  497.        Simplification may also be obtained in simulation if one  considers
  498.        how the design works. A classic 4-bit adder with Carry In and Out
  499.        would require 29=512 input test conditions to exhaustivly test all
  500.        possible combinations. A file with large number of test vectors runs
  501.        the danger of running out of memory before the task is complete.  In
  502.        our designs, however, we used independent two 2 bit adders.
  503.        
  504.        A 2 bit adder requires only 25=32 combinations for an  exhaustive
  505.        test. Noting that the Carry Out has 16 of the 32 input conditions
  506.        with a HIGH result and 16 with a LOW result we may test both halves
  507.        of the adder. By noting where C2 is a "0" and where it is a "1"
  508.        allows the designer to correctly place the tests for the second
  509.        module in parallel with the first module. This shortened example can
  510.        be seen as applied to the 8-bit adder in ADD_8B.PDS.
  511.        
  512.        The number of simulation vectors is important since the  software can
  513.        process only so many. It is limited by the number of vectors and the
  514.        number of signals within the simulation commands. Not only will many
  515.        vectors consume more time, but, it may well run out of memory, before
  516.        any results are obtained.
  517.  
  518. ----------------------------------------------------------------------------
  519.  
  520.  
  521.