Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
OPERATORS
LOGIC OPERATORS:
(AND ,OR, NOT, NAND, NOR,
XOR, XNOR )
Relational Operators:
= equal to
/= not equal to
< less than
<= less then or equal to
> greater than
>= greater than or equal to
Adding Operators
+ addition
subtraction
& concatenation
Multiplying Operators
*Multiplication
/ division
mod modulus
rem remainder
Misc. Operators
** exponentiation
left operand = integer or
floating point
right operand = integer
only
abs absolute value
not inversion
Johnson Counter
A Johnson counter simply connects the complement of its serial
output back to its serial input
If a Johnson counter is cleared when reset, its serial output is 0.
Since the complement of its serial output appears at its serial input,
at each subsequent triggering clock edge a 1 is shifted in, until the
counter is filled with 1s
With its serial output now a 1, a 0 is shifted in at each subsequent
triggering clock edge, until the counter is filled with 0s, making its
serial output a 0
From this point, the count sequence repeats
Johnson Counter
The number of unique states a counter has is its modulus
The count (or state sequence) for a Johnson counter is 2 n counts
long (modulus 2 n), where n is the number of stages in the shift
register
RING COUNTER
A ring counter feeds its serial output directly back to its serial input
If at reset the shift register is loaded with a single 1, this 1 is
shifted around the register over and over. The length of the count
sequence is simply n
COUNTERS
counters are used to count events, generate time
intervals, generate events, and divide down an input
signal to create a lower frequency output signal
A counters next state is the state it goes to from its
present state at a triggering clock edge
A simple counter transitions from one unique state to
another, until it eventually returns to its initial state, after
which its state transitions repeat.
COUNTERS
The state transitions of a counter are clearly depicted by a state
diagram
A state diagram for a 3-bit binary up counter is given in Fig
The counter is initialized to 000 at reset and counts up to 111 before
recycling to 000.
A 3-bit binary counter has a modulus of 8, or is, equivalently, a
modulo-8 counter
COUNTERS
Two ways to solve this problem are:
1. Use type integer signals or variables along with the
predefined + and operators, then use functions to
convert the integer results to std_logic
2. Use type unsigned from the package NUMERIC_STD,
which also overloads the + and operators for this type,
then convert the unsigned results to std_logic_vector
Frequency Divider
A truncated sequence counter counts through a sequence that is not a power of 2
If at a triggering clock edge the present count is the last count desired in the sequence,
the counter is loaded with the starting (initial) count value, instead of being
incremented to the next binary count
The counter counts the input load value (divisor) down by one at
each triggering clock edge
When the present count is "0010" at a triggering clock edge, the
count goes to "0001" and simultaneously output q becomes '1
When the present state is "0001", the counter loads the value of
divisor at the next triggering clock edge and simultaneously q
becomes '0'.
BCD Counters
It counts in decimal, a two-digit BCD counter counts from 00 decimal to 99 decimal. On the
next count, it rolls over to 00 decimal
The least significant four bits of the counter represent the least significant decimal digit (0
to 9) encoded in BCD
The most significant four bits represent the most significant decimal digit, encoded in BCD
Since a BCD digit ranges from 0000 to 1001 in binary, when the counters value is
00001001 (09 decimal), its value on the next count must change to 00010000 (10 decimal).
BLOCK DIAGRAM
MEMORIES
We consider memories that consist of multiple multi-bit
latches or multiple registers
Such a memory is a single storage unit that consists of a
two-dimensional array of memory elements
This two-dimensional array of bits is equivalent to a onedimensional array of multi-bit latches or registers
To be uniquely identified, each multi-bit latch or register
has an address.
MEMORIES
The external organization of a memory is expressed as the
number of words the number of bits per word in the
memory. This is also referred to as the length width, or
depth width, or aspect ratio of the memory
It is typically written as 2m n, where m is the number of
address inputs used to select a single word from the array of
words and n is the number of data bits in each word
For example, a 16 8 memory contains 16 words each 8 bits
wide. It has 4 address bits (inputs).
MEMORIES
RAM stands for random access memory. A random access memory is
one in which the amount of time it takes to read (access) a word from
any one address (location in the memory) is essentially the same as for
reading from any other address in the memory
This is in contrast to what is the case for a serial memory. However, the
term RAM is commonly used to mean a memory that can be written and
read during its normal operation
This is in contrast to read-only memory (ROM), which although
random access, can only be read during its normal operation. A ROMs
contents are defined only once; therefore, a ROM stores constant values
MEMORIES