Diferență între revizuiri ale paginii „ROM Memory”
Cbira (discuție | contribuții) |
Cbira (discuție | contribuții) |
||
Linia 18: | Linia 18: | ||
* with blocks '''assign''' and '''conditional operator'''; | * with blocks '''assign''' and '''conditional operator'''; | ||
* with blocks '''always''' combinational and sub-blocks '''if'''; | * with blocks '''always''' combinational and sub-blocks '''if'''; | ||
− | * with '' always''' blocks' and | + | * with '' always''' blocks' and '''case''' blocks. |
The preferred method is the last because of the ease of the description (see [[Verilog #Blocks and Conditional Operators | Conditional Operators]]). | The preferred method is the last because of the ease of the description (see [[Verilog #Blocks and Conditional Operators | Conditional Operators]]). |
Versiunea de la data 12 aprilie 2018 07:54
Most functions implemented by combinational circuits can be described analytically, ie the output can be calculated by applying operators (addition, subtraction, shift, logic operations) of the inputs. Such functions are those that you have implemented in lab 1 and 2. However, there are cases where there is no clear relationship between the input value and the output value, so a rule can not be applied for calculating the latter. In this case, the solution is to use a Read-Only Memory (ROM), also called the Lookup Table (LUT), which has the role of storing the corresponding output value for each input value.
Interface of ROM ROM
A ROM, as a circuit, has a single input, which specifies the input value, and a single output on which the function value for the specified input propagates. For each entry value, a ROM has a memory location that is accessed when the corresponding value appears on the input port. The location value is propagated to the output port. Thus, a ROM has two important parameters:
- the bit number of the input port (representing the memory address), which determines the total number of memory locations, denoted M;
- bit number of the output port (equal to the number of bits of each memory location), denoted N;
Note: If the input port has M bits, then the total number of possible addresses or the total number of ROM locations is 2 M . So the total number of ROMs (memory capacity) is the product of the total number of locations (2 M ) and the bit size of a location (N).
Implementing a ROM memory
Being a combined circuit in Verilog, deploying a ROM can be done in three ways:
- with blocks assign and conditional operator;
- with blocks always combinational and sub-blocks if;
- with always' blocks' and case blocks.
The preferred method is the last because of the ease of the description (see Conditional Operators).