Changes

Jump to navigation Jump to search
2,455 bytes added ,  15:00, 6 July 2007
no edit summary
Line 6: Line 6:     
== Where to start ==
 
== Where to start ==
 +
 +
=== The black box ===
    
The first part of the design process is completely independent of any code.  The first step is to define the "black box" of your circuit; that is, draw a box and say what goes in and what comes out.  VHDL allows three types of ''pins'' (connections to the outside world):
 
The first part of the design process is completely independent of any code.  The first step is to define the "black box" of your circuit; that is, draw a box and say what goes in and what comes out.  VHDL allows three types of ''pins'' (connections to the outside world):
Line 12: Line 14:  
* '''inout''': An ''inout'' pin can be both read from and written to, providing the flexibility to allow bidirectional communication on a single line.  At first this seems the ideal choice and that you would always want inout pins; in actual fact you want to avoid inout pins unless you absolutely need them for bidirectional communication.
 
* '''inout''': An ''inout'' pin can be both read from and written to, providing the flexibility to allow bidirectional communication on a single line.  At first this seems the ideal choice and that you would always want inout pins; in actual fact you want to avoid inout pins unless you absolutely need them for bidirectional communication.
    +
=== Example: the block box ===
 +
 +
For the DAC emulator, the inputs are clearly defined for us.  The AD5535 data sheet discusses the [[http://zeus.phys.uconn.edu/wiki/index.php?title=Programming_the_FPGA#Interface_.28D.29|serial interface protocol]] in detail.  We need four input lines:
 +
* ''/Reset'': an asynchronous, active-low reset line
 +
* ''D_in'': serial data line
 +
* ''/Sync'': an active-low flag to being transmission
 +
* ''SClk'': a serial clock
 +
 +
Our outputs are not so clearly defined.  This emulates the circuit itself, so the output of the black box is purely for our benefit to aid in testing.  So I decided to define as outputs 32 channels, each 14-bits wide, which display the value being fed to each DAC at any given time.
 +
 +
Some notes on nomenclature and notation:
 +
* The term '''signal''' is used to generically refer to a line, pin, or bus.
 +
* Signals come in '''active-high''' and '''active-low''' varieties.  Active-high means that a logical 1 is "on" and a logical 0 is "off".  It is also known as "positive logic".  Active-low is the exact opposite; logical 0 is "on" and logical 1 is "off", and it is alternately known as "negative logic".
 +
* Some signals serve double-duty.  As active-high logic they perform one operation, but as active-low logic they perform another operation.  This links these operations as complimentary pairs.  For example a shift register may shift its output or it may load a new value.  If it's not shifting then it's loading.  So the name would be something like "Shift/Load" to signify that shifting is active-high and loading is active-low.  Carrying over this notation, any signal that is written "/Name" is an active-low signal.  This notation is not always used, but it is quite common and I shall attempt to maintain this practice throughout the tutorial.  When writing on paper, an active-low signal is frequently denoted by an overbar instead of a leading slash.
 +
* A '''pin''' is an input, output, or inout.  A '''line''' is a single pin or a single bit of data flowing along a wire.  A '''bus''' is properly a multidrop line, but through common usage (due to the way circuits are commonly designed), in digital logic at this level the term has come to mean multiple lines bound together into a bundle.  On a diagram, a bus appears as a thick line with a slash through it.  Near the slash will be a number denoting how many lines are bundled into that bus.
    +
=== The block diagram ===
    
Having defined your block box, you need to fill in your black box.
 
Having defined your block box, you need to fill in your black box.
461

edits

Navigation menu