OpenCores
URL https://opencores.org/ocsvn/mlite/mlite/trunk

Subversion Repositories mlite

[/] [mlite/] [trunk/] [vhdl/] [mlite_pack.vhd] - Blame information for rev 194

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 rhoads
---------------------------------------------------------------------
2 43 rhoads
-- TITLE: Plasma Misc. Package
3 39 rhoads
-- AUTHOR: Steve Rhoads (rhoadss@yahoo.com)
4
-- DATE CREATED: 2/15/01
5
-- FILENAME: mlite_pack.vhd
6 43 rhoads
-- PROJECT: Plasma CPU core
7 39 rhoads
-- COPYRIGHT: Software placed into the public domain by the author.
8
--    Software 'as is' without warranty.  Author liable for nothing.
9
-- DESCRIPTION:
10 43 rhoads
--    Data types, constants, and add functions needed for the Plasma CPU.
11 39 rhoads
---------------------------------------------------------------------
12
library ieee;
13
use ieee.std_logic_1164.all;
14
 
15
package mlite_pack is
16
   constant ZERO          : std_logic_vector(31 downto 0) :=
17
      "00000000000000000000000000000000";
18
   constant ONES          : std_logic_vector(31 downto 0) :=
19
      "11111111111111111111111111111111";
20
   --make HIGH_Z equal to ZERO if compiler complains
21
   constant HIGH_Z        : std_logic_vector(31 downto 0) :=
22
      "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
23
 
24 91 rhoads
   subtype alu_function_type is std_logic_vector(3 downto 0);
25 128 rhoads
   constant ALU_NOTHING   : alu_function_type := "0000";
26
   constant ALU_ADD       : alu_function_type := "0001";
27
   constant ALU_SUBTRACT  : alu_function_type := "0010";
28
   constant ALU_LESS_THAN : alu_function_type := "0011";
29
   constant ALU_LESS_THAN_SIGNED : alu_function_type := "0100";
30
   constant ALU_OR        : alu_function_type := "0101";
31
   constant ALU_AND       : alu_function_type := "0110";
32
   constant ALU_XOR       : alu_function_type := "0111";
33
   constant ALU_NOR       : alu_function_type := "1000";
34 39 rhoads
 
35
   subtype shift_function_type is std_logic_vector(1 downto 0);
36 128 rhoads
   constant SHIFT_NOTHING        : shift_function_type := "00";
37
   constant SHIFT_LEFT_UNSIGNED  : shift_function_type := "01";
38
   constant SHIFT_RIGHT_SIGNED   : shift_function_type := "11";
39
   constant SHIFT_RIGHT_UNSIGNED : shift_function_type := "10";
40 39 rhoads
 
41 44 rhoads
   subtype mult_function_type is std_logic_vector(3 downto 0);
42 128 rhoads
   constant MULT_NOTHING       : mult_function_type := "0000";
43
   constant MULT_READ_LO       : mult_function_type := "0001";
44
   constant MULT_READ_HI       : mult_function_type := "0010";
45
   constant MULT_WRITE_LO      : mult_function_type := "0011";
46
   constant MULT_WRITE_HI      : mult_function_type := "0100";
47
   constant MULT_MULT          : mult_function_type := "0101";
48
   constant MULT_SIGNED_MULT   : mult_function_type := "0110";
49
   constant MULT_DIVIDE        : mult_function_type := "0111";
50
   constant MULT_SIGNED_DIVIDE : mult_function_type := "1000";
51 39 rhoads
 
52
   subtype a_source_type is std_logic_vector(1 downto 0);
53 128 rhoads
   constant A_FROM_REG_SOURCE : a_source_type := "00";
54
   constant A_FROM_IMM10_6    : a_source_type := "01";
55
   constant A_FROM_PC         : a_source_type := "10";
56 39 rhoads
 
57
   subtype b_source_type is std_logic_vector(1 downto 0);
58 128 rhoads
   constant B_FROM_REG_TARGET : b_source_type := "00";
59
   constant B_FROM_IMM        : b_source_type := "01";
60
   constant B_FROM_SIGNED_IMM : b_source_type := "10";
61
   constant B_FROM_IMMX4      : b_source_type := "11";
62 39 rhoads
 
63
   subtype c_source_type is std_logic_vector(2 downto 0);
64 128 rhoads
   constant C_FROM_NULL       : c_source_type := "000";
65
   constant C_FROM_ALU        : c_source_type := "001";
66
   constant C_FROM_SHIFT      : c_source_type := "001"; --same as alu
67
   constant C_FROM_MULT       : c_source_type := "001"; --same as alu
68
   constant C_FROM_MEMORY     : c_source_type := "010";
69
   constant C_FROM_PC         : c_source_type := "011";
70
   constant C_FROM_PC_PLUS4   : c_source_type := "100";
71
   constant C_FROM_IMM_SHIFT16: c_source_type := "101";
72
   constant C_FROM_REG_SOURCEN: c_source_type := "110";
73 39 rhoads
 
74
   subtype pc_source_type is std_logic_vector(1 downto 0);
75 128 rhoads
   constant FROM_INC4       : pc_source_type := "00";
76
   constant FROM_OPCODE25_0 : pc_source_type := "01";
77
   constant FROM_BRANCH     : pc_source_type := "10";
78
   constant FROM_LBRANCH    : pc_source_type := "11";
79 39 rhoads
 
80
   subtype branch_function_type is std_logic_vector(2 downto 0);
81 128 rhoads
   constant BRANCH_LTZ : branch_function_type := "000";
82
   constant BRANCH_LEZ : branch_function_type := "001";
83
   constant BRANCH_EQ  : branch_function_type := "010";
84
   constant BRANCH_NE  : branch_function_type := "011";
85
   constant BRANCH_GEZ : branch_function_type := "100";
86
   constant BRANCH_GTZ : branch_function_type := "101";
87
   constant BRANCH_YES : branch_function_type := "110";
88 139 rhoads
   constant BRANCH_NO  : branch_function_type := "111";
89 39 rhoads
 
90
   -- mode(32=1,16=2,8=3), signed, write
91
   subtype mem_source_type is std_logic_vector(3 downto 0);
92 128 rhoads
   constant MEM_FETCH   : mem_source_type := "0000";
93
   constant MEM_READ32  : mem_source_type := "0100";
94
   constant MEM_WRITE32 : mem_source_type := "0101";
95
   constant MEM_READ16  : mem_source_type := "1000";
96 139 rhoads
   constant MEM_READ16S : mem_source_type := "1010";
97 128 rhoads
   constant MEM_WRITE16 : mem_source_type := "1001";
98
   constant MEM_READ8   : mem_source_type := "1100";
99 139 rhoads
   constant MEM_READ8S  : mem_source_type := "1110";
100 128 rhoads
   constant MEM_WRITE8  : mem_source_type := "1101";
101 39 rhoads
 
102 139 rhoads
   function bv_adder(a     : in std_logic_vector;
103
                     b     : in std_logic_vector;
104 47 rhoads
                     do_add: in std_logic) return std_logic_vector;
105 39 rhoads
   function bv_negate(a : in std_logic_vector) return std_logic_vector;
106
   function bv_increment(a : in std_logic_vector(31 downto 2)
107 139 rhoads
                         ) return std_logic_vector;
108
   function bv_inc(a : in std_logic_vector
109
                  ) return std_logic_vector;
110 47 rhoads
 
111
   -- For Altera
112
   COMPONENT lpm_add_sub
113
      GENERIC (
114 91 rhoads
         lpm_width     : NATURAL;
115
         lpm_direction : STRING := "UNUSED";
116
         lpm_type      : STRING;
117
         lpm_hint      : STRING);
118 47 rhoads
      PORT (
119 91 rhoads
         dataa   : IN STD_LOGIC_VECTOR (lpm_width-1 DOWNTO 0);
120
         add_sub : IN STD_LOGIC ;
121
         datab   : IN STD_LOGIC_VECTOR (lpm_width-1 DOWNTO 0);
122
         result  : OUT STD_LOGIC_VECTOR (lpm_width-1 DOWNTO 0));
123 47 rhoads
   END COMPONENT;
124
 
125
   -- For Altera
126
   COMPONENT lpm_ram_dp
127
      GENERIC (
128
         lpm_width        : NATURAL;
129
         lpm_widthad      : NATURAL;
130
         rden_used        : STRING;
131
         intended_device_family : STRING;
132
         lpm_indata       : STRING;
133
         lpm_wraddress_control          : STRING;
134
         lpm_rdaddress_control          : STRING;
135
         lpm_outdata      : STRING;
136
         use_eab          : STRING;
137
         lpm_type         : STRING);
138
      PORT (
139 91 rhoads
         wren      : IN STD_LOGIC ;
140 47 rhoads
         wrclock   : IN STD_LOGIC ;
141 91 rhoads
         q         : OUT STD_LOGIC_VECTOR (lpm_width-1 DOWNTO 0);
142
         data      : IN STD_LOGIC_VECTOR (lpm_width-1 DOWNTO 0);
143
         rdaddress : IN STD_LOGIC_VECTOR (lpm_widthad-1 DOWNTO 0);
144
         wraddress : IN STD_LOGIC_VECTOR (lpm_widthad-1 DOWNTO 0));
145 47 rhoads
   END COMPONENT;
146
 
147
   -- For Altera
148 62 rhoads
   component LPM_RAM_DQ
149
      generic (
150 91 rhoads
         LPM_WIDTH    : natural;    -- MUST be greater than 0
151
         LPM_WIDTHAD  : natural;    -- MUST be greater than 0
152 62 rhoads
         LPM_NUMWORDS : natural := 0;
153 91 rhoads
         LPM_INDATA   : string := "REGISTERED";
154 62 rhoads
         LPM_ADDRESS_CONTROL: string := "REGISTERED";
155 91 rhoads
         LPM_OUTDATA  : string := "REGISTERED";
156
         LPM_FILE     : string := "UNUSED";
157
         LPM_TYPE     : string := "LPM_RAM_DQ";
158
         USE_EAB      : string := "OFF";
159 62 rhoads
         INTENDED_DEVICE_FAMILY  : string := "UNUSED";
160 91 rhoads
         LPM_HINT     : string := "UNUSED");
161 62 rhoads
                port (
162
         DATA     : in std_logic_vector(LPM_WIDTH-1 downto 0);
163
         ADDRESS  : in std_logic_vector(LPM_WIDTHAD-1 downto 0);
164
         INCLOCK  : in std_logic := '0';
165
         OUTCLOCK : in std_logic := '0';
166
         WE       : in std_logic;
167
         Q        : out std_logic_vector(LPM_WIDTH-1 downto 0));
168
   end component;
169 47 rhoads
 
170
   -- For Xilinx
171
   component ramb4_s16_s16
172
      port (
173
         clka  : in std_logic;
174
         rsta  : in std_logic;
175
         addra : in std_logic_vector;
176
         dia   : in std_logic_vector;
177
         ena   : in std_logic;
178
         wea   : in std_logic;
179
         doa   : out std_logic_vector;
180
 
181
         clkb  : in std_logic;
182
         rstb  : in std_logic;
183
         addrb : in std_logic_vector;
184
         dib   : in std_logic_vector;
185
         enb   : in std_logic;
186
         web   : in std_logic);
187
   end component;
188
 
189 116 rhoads
   -- For Xilinx
190
   component reg_file_dp_ram
191 139 rhoads
      port (
192
         addra : IN  std_logic_VECTOR(4 downto 0);
193
         addrb : IN  std_logic_VECTOR(4 downto 0);
194
         clka  : IN  std_logic;
195
         clkb  : IN  std_logic;
196
         dinb  : IN  std_logic_VECTOR(31 downto 0);
197
         douta : OUT std_logic_VECTOR(31 downto 0);
198
         web   : IN  std_logic);
199 116 rhoads
   end component;
200
 
201
   -- For Xilinx
202
   component reg_file_dp_ram_xc4000xla
203 139 rhoads
      port (
204
         A      : IN  std_logic_vector(4 DOWNTO 0);
205
         DI     : IN  std_logic_vector(31 DOWNTO 0);
206
         WR_EN  : IN  std_logic;
207
         WR_CLK : IN  std_logic;
208
         DPRA   : IN  std_logic_vector(4 DOWNTO 0);
209
         SPO    : OUT std_logic_vector(31 DOWNTO 0);
210
         DPO    : OUT std_logic_vector(31 DOWNTO 0));
211 116 rhoads
   end component;
212
 
213 47 rhoads
   component pc_next
214 139 rhoads
      port(clk         : in std_logic;
215
           reset_in    : in std_logic;
216
           pc_new      : in std_logic_vector(31 downto 2);
217
           take_branch : in std_logic;
218
           pause_in    : in std_logic;
219
           opcode25_0  : in std_logic_vector(25 downto 0);
220
           pc_source   : in pc_source_type;
221
           pc_future   : out std_logic_vector(31 downto 2);
222
           pc_current  : out std_logic_vector(31 downto 2);
223
           pc_plus4    : out std_logic_vector(31 downto 2));
224 47 rhoads
   end component;
225
 
226
   component mem_ctrl
227
      port(clk          : in std_logic;
228
           reset_in     : in std_logic;
229
           pause_in     : in std_logic;
230
           nullify_op   : in std_logic;
231 139 rhoads
           address_pc   : in std_logic_vector(31 downto 2);
232 47 rhoads
           opcode_out   : out std_logic_vector(31 downto 0);
233
 
234 139 rhoads
           address_in   : in std_logic_vector(31 downto 0);
235 47 rhoads
           mem_source   : in mem_source_type;
236
           data_write   : in std_logic_vector(31 downto 0);
237
           data_read    : out std_logic_vector(31 downto 0);
238
           pause_out    : out std_logic;
239
 
240 139 rhoads
           mem_address  : out std_logic_vector(31 downto 2);
241 47 rhoads
           mem_data_w   : out std_logic_vector(31 downto 0);
242
           mem_data_r   : in std_logic_vector(31 downto 0);
243 139 rhoads
           mem_byte_we  : out std_logic_vector(3 downto 0));
244 47 rhoads
   end component;
245
 
246
   component control
247
      port(opcode       : in  std_logic_vector(31 downto 0);
248
           intr_signal  : in  std_logic;
249
           rs_index     : out std_logic_vector(5 downto 0);
250
           rt_index     : out std_logic_vector(5 downto 0);
251
           rd_index     : out std_logic_vector(5 downto 0);
252
           imm_out      : out std_logic_vector(15 downto 0);
253
           alu_func     : out alu_function_type;
254
           shift_func   : out shift_function_type;
255
           mult_func    : out mult_function_type;
256
           branch_func  : out branch_function_type;
257
           a_source_out : out a_source_type;
258
           b_source_out : out b_source_type;
259
           c_source_out : out c_source_type;
260
           pc_source_out: out pc_source_type;
261 194 rhoads
           mem_source_out:out mem_source_type;
262
           exception_out: out std_logic);
263 47 rhoads
   end component;
264
 
265
   component reg_bank
266 139 rhoads
      generic(memory_type : string := "XILINX_16X");
267 47 rhoads
      port(clk            : in  std_logic;
268
           reset_in       : in  std_logic;
269 70 rhoads
           pause          : in  std_logic;
270 47 rhoads
           rs_index       : in  std_logic_vector(5 downto 0);
271
           rt_index       : in  std_logic_vector(5 downto 0);
272
           rd_index       : in  std_logic_vector(5 downto 0);
273
           reg_source_out : out std_logic_vector(31 downto 0);
274
           reg_target_out : out std_logic_vector(31 downto 0);
275
           reg_dest_new   : in  std_logic_vector(31 downto 0);
276
           intr_enable    : out std_logic);
277
   end component;
278
 
279
   component bus_mux
280
      port(imm_in       : in  std_logic_vector(15 downto 0);
281
           reg_source   : in  std_logic_vector(31 downto 0);
282
           a_mux        : in  a_source_type;
283
           a_out        : out std_logic_vector(31 downto 0);
284
 
285
           reg_target   : in  std_logic_vector(31 downto 0);
286
           b_mux        : in  b_source_type;
287
           b_out        : out std_logic_vector(31 downto 0);
288
 
289
           c_bus        : in  std_logic_vector(31 downto 0);
290
           c_memory     : in  std_logic_vector(31 downto 0);
291 139 rhoads
           c_pc         : in  std_logic_vector(31 downto 2);
292
           c_pc_plus4   : in  std_logic_vector(31 downto 2);
293 47 rhoads
           c_mux        : in  c_source_type;
294
           reg_dest_out : out std_logic_vector(31 downto 0);
295
 
296
           branch_func  : in  branch_function_type;
297
           take_branch  : out std_logic);
298
   end component;
299
 
300
   component alu
301 139 rhoads
      generic(alu_type  : string := "DEFAULT");
302 47 rhoads
      port(a_in         : in  std_logic_vector(31 downto 0);
303
           b_in         : in  std_logic_vector(31 downto 0);
304
           alu_function : in  alu_function_type;
305
           c_alu        : out std_logic_vector(31 downto 0));
306
   end component;
307
 
308
   component shifter
309 139 rhoads
      generic(shifter_type : string := "DEFAULT" );
310 47 rhoads
      port(value        : in  std_logic_vector(31 downto 0);
311
           shift_amount : in  std_logic_vector(4 downto 0);
312
           shift_func   : in  shift_function_type;
313
           c_shift      : out std_logic_vector(31 downto 0));
314
   end component;
315
 
316
   component mult
317 139 rhoads
      generic(mult_type  : string := "DEFAULT");
318
      port(clk       : in  std_logic;
319
           reset_in  : in  std_logic;
320
           a, b      : in  std_logic_vector(31 downto 0);
321
           mult_func : in  mult_function_type;
322
           c_mult    : out std_logic_vector(31 downto 0);
323
           pause_out : out std_logic);
324 47 rhoads
   end component;
325
 
326 70 rhoads
   component pipeline
327
      port(clk            : in  std_logic;
328
           reset          : in  std_logic;
329
           a_bus          : in  std_logic_vector(31 downto 0);
330
           a_busD         : out std_logic_vector(31 downto 0);
331
           b_bus          : in  std_logic_vector(31 downto 0);
332
           b_busD         : out std_logic_vector(31 downto 0);
333
           alu_func       : in  alu_function_type;
334
           alu_funcD      : out alu_function_type;
335
           shift_func     : in  shift_function_type;
336
           shift_funcD    : out shift_function_type;
337
           mult_func      : in  mult_function_type;
338
           mult_funcD     : out mult_function_type;
339
           reg_dest       : in  std_logic_vector(31 downto 0);
340
           reg_destD      : out std_logic_vector(31 downto 0);
341
           rd_index       : in  std_logic_vector(5 downto 0);
342
           rd_indexD      : out std_logic_vector(5 downto 0);
343
 
344
           rs_index       : in  std_logic_vector(5 downto 0);
345
           rt_index       : in  std_logic_vector(5 downto 0);
346
           pc_source      : in  pc_source_type;
347
           mem_source     : in  mem_source_type;
348
           a_source       : in  a_source_type;
349
           b_source       : in  b_source_type;
350
           c_source       : in  c_source_type;
351
           c_bus          : in  std_logic_vector(31 downto 0);
352
           pause_any      : in  std_logic;
353
           pause_pipeline : out std_logic);
354
   end component;
355
 
356 47 rhoads
   component mlite_cpu
357 139 rhoads
      generic(memory_type     : string := "XILINX_16X"; --ALTERA_LPM, or DUAL_PORT_
358 132 rhoads
              mult_type       : string := "DEFAULT";
359
              shifter_type    : string := "DEFAULT";
360 139 rhoads
              alu_type        : string := "DEFAULT";
361
              pipeline_stages : natural := 3); --3 or 4
362 47 rhoads
      port(clk         : in std_logic;
363
           reset_in    : in std_logic;
364
           intr_in     : in std_logic;
365
 
366
           mem_address : out std_logic_vector(31 downto 0);
367
           mem_data_w  : out std_logic_vector(31 downto 0);
368
           mem_data_r  : in std_logic_vector(31 downto 0);
369 139 rhoads
           mem_byte_we : out std_logic_vector(3 downto 0);
370 47 rhoads
           mem_pause   : in std_logic);
371
   end component;
372
 
373 50 rhoads
   component ram
374 132 rhoads
      generic(memory_type : string := "DEFAULT");
375 139 rhoads
      port(clk               : in std_logic;
376
           enable            : in std_logic;
377
           write_byte_enable : in std_logic_vector(3 downto 0);
378
           address           : in std_logic_vector(31 downto 2);
379
           data_write        : in std_logic_vector(31 downto 0);
380
           data_read         : out std_logic_vector(31 downto 0));
381 47 rhoads
   end component; --ram
382
 
383
   component uart
384 50 rhoads
      generic(log_file : string := "UNUSED");
385 139 rhoads
      port(clk          : in std_logic;
386
           reset        : in std_logic;
387
           enable_read  : in std_logic;
388
           enable_write : in std_logic;
389
           data_in      : in std_logic_vector(7 downto 0);
390
           data_out     : out std_logic_vector(7 downto 0);
391
           uart_read    : in std_logic;
392
           uart_write   : out std_logic;
393
           busy_write   : out std_logic;
394
           data_avail   : out std_logic);
395 47 rhoads
   end component; --uart
396
 
397 50 rhoads
   component plasma
398 139 rhoads
      generic(memory_type : string := "XILINX_X16"; --"DUAL_PORT_" "ALTERA_LPM";
399 50 rhoads
              log_file    : string := "UNUSED");
400 139 rhoads
      port(clk               : in std_logic;
401
           reset             : in std_logic;
402
           uart_write        : out std_logic;
403
           uart_read         : in std_logic;
404
 
405
           address           : out std_logic_vector(31 downto 2);
406
           data_write        : out std_logic_vector(31 downto 0);
407
           data_read         : in std_logic_vector(31 downto 0);
408
           write_byte_enable : out std_logic_vector(3 downto 0);
409
           mem_pause_in      : in std_logic;
410
 
411
           gpio0_out         : out std_logic_vector(31 downto 0);
412
           gpioA_in          : in std_logic_vector(31 downto 0));
413 50 rhoads
   end component; --plasma
414
 
415 139 rhoads
end; --package mlite_pack
416 62 rhoads
 
417
 
418 39 rhoads
package body mlite_pack is
419
 
420 139 rhoads
function bv_adder(a     : in std_logic_vector;
421
                  b     : in std_logic_vector;
422 47 rhoads
                  do_add: in std_logic) return std_logic_vector is
423 39 rhoads
   variable carry_in : std_logic;
424 139 rhoads
   variable bb       : std_logic_vector(a'length-1 downto 0);
425
   variable result   : std_logic_vector(a'length downto 0);
426 39 rhoads
begin
427 47 rhoads
   if do_add = '1' then
428 39 rhoads
      bb := b;
429
      carry_in := '0';
430
   else
431
      bb := not b;
432
      carry_in := '1';
433
   end if;
434 139 rhoads
   for index in 0 to a'length-1 loop
435 39 rhoads
      result(index) := a(index) xor bb(index) xor carry_in;
436
      carry_in := (carry_in and (a(index) or bb(index))) or
437
                  (a(index) and bb(index));
438
   end loop;
439 139 rhoads
   result(a'length) := carry_in xnor do_add;
440 39 rhoads
   return result;
441
end; --function
442
 
443 91 rhoads
 
444 39 rhoads
function bv_negate(a : in std_logic_vector) return std_logic_vector is
445
   variable carry_in : std_logic;
446 139 rhoads
   variable not_a    : std_logic_vector(a'length-1 downto 0);
447
   variable result   : std_logic_vector(a'length-1 downto 0);
448 39 rhoads
begin
449
   not_a := not a;
450
   carry_in := '1';
451
   for index in a'reverse_range loop
452
      result(index) := not_a(index) xor carry_in;
453
      carry_in := carry_in and not_a(index);
454
   end loop;
455
   return result;
456
end; --function
457
 
458 91 rhoads
 
459 39 rhoads
function bv_increment(a : in std_logic_vector(31 downto 2)
460
                     ) return std_logic_vector is
461
   variable carry_in : std_logic;
462
   variable result   : std_logic_vector(31 downto 2);
463
begin
464
   carry_in := '1';
465
   for index in 2 to 31 loop
466
      result(index) := a(index) xor carry_in;
467
      carry_in := a(index) and carry_in;
468
   end loop;
469
   return result;
470
end; --function
471
 
472 91 rhoads
 
473 139 rhoads
function bv_inc(a : in std_logic_vector
474
                ) return std_logic_vector is
475 39 rhoads
   variable carry_in : std_logic;
476 139 rhoads
   variable result   : std_logic_vector(a'length-1 downto 0);
477 39 rhoads
begin
478
   carry_in := '1';
479 139 rhoads
   for index in 0 to a'length-1 loop
480 39 rhoads
      result(index) := a(index) xor carry_in;
481
      carry_in := a(index) and carry_in;
482
   end loop;
483
   return result;
484
end; --function
485
 
486
end; --package body
487
 
488
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.