VHDL Programming
82 Chapter Four A typical enumerated type for a four-state simulation value system looks like this: TYPE fourval IS ( ‘X’, ‘ 0 ’ ...
Data Types 83 END instr; USE WORK.instr.ALL; ENTITY mp IS PORT (instr : IN instruction; PORT (addr : IN INTEGER; PORT (data : IN ...
84 Chapter Four or FPGA devices. They represent a very easy and understandable method for specifying a sequence of actions over ...
Data Types 85 PHYSICAL TYPES Physical types are used to represent physical quantities such as distance, current, time, and so on ...
86 Chapter Four The range of time is implementation-defined but has to be at least the range of integer, in base units. This typ ...
Data Types 87 elements of different types. Arrays are useful for modeling linear struc- tures such as RAMs and ROMs, while recor ...
88 Chapter Four USE WORK.array_example.ALL; ENTITY extract IS PORT (data : IN data_bus; PORT (start : IN INTEGER; PORT (data_out ...
Data Types 89 ARCHITECTURE basic OF rom IS CONSTANT z_state : data_out := (‘Z’, ‘Z’, ‘Z’, ‘Z’); CONSTANT x_state : data_out := ( ...
90 Chapter Four Addr Bit 3 Bit 2 Bit 1 Bit 0 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 Fig ...
Data Types 91 value := ((e1, e2,..., en), --E1 value := ((e1, e2,..., en), --E2 value := (((...... value := (((...... value := ( ...
92 Chapter Four This access returns the fourth element of the fourth row, which, in this example, is a ‘ 1 ’. UNCONSTRAINED ARRA ...
Data Types 93 IS VARIABLE result : BIT_VECTOR(0 TO (val’LENGTH -1)); BEGIN result := val; IF (val’LENGTH > 1) THEN FOR i IN 0 ...
94 Chapter Four TYPE instruction IS RECORD opcode : optype; src : INTEGER; dst : INTEGER; END RECORD; The first line declares th ...
Data Types 95 Lines 5 and 6 show that not only can record fields be read from, but they can be assigned to as well. In these two ...
96 Chapter Four packet.data(10)(4) := ‘ 1 ’; --error line 4 packet.data(10)(0) := ‘ 1 ’; --Ok line 5 END PROCESS; This example s ...
Data Types 97 PROCESS(X) TYPE fifo_element_t IS ARRAY(0 TO 3) OF std_logic; --line 1 TYPE fifo_el_access IS ACCESS fifo_element_ ...
98 Chapter Four Fifo Element fifo_ptr temp_ptr Figure 4-3 Multiple Access Type References. Incomplete Types When implementing re ...
Data Types 99 temp_elem.nxt := list_head; --line 16 list_head := temp_elem; --line 17 --read mode --line 18 ELSIF (r_wb = ‘ 1 ’) ...
100 Chapter Four data. It always points to the first element of the list of items in the stack. Variable temp_elemis used to hol ...
Data Types 101 Stack Element Data NXT Stack Element Data NXT Stack Element Data NXT List_Head Temp_Elem Figure 4-5 Point New Ele ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf