The Difference between the two processes

Status
Not open for further replies.

Digit0001

Member level 1
Joined
Jun 12, 2010
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,547
Hi

Can someone tell me the difference between the two processes?

Code:
	process(A)
		variable start : bit :='0';
		begin
			Start :='0';
			For i in 0 to 3 loop
				start := start or A(i);
			end loop;
			x <= Start;
	end process;
Code:
	process(A)
		variable start : bit_vector(4 downto 0);
		begin
			start(0) :='0';
			For i in 0 to 3 loop
				start(i+1) := start(i) or A(i);
			end loop;
			x <= start(4);
	end process;

P.S
 

There is no difference. They both just OR all of the bits in A.

All of that code could be replaced with

x <= or_reduce(A);
 

From what i see these two give the same result, the first one uses a 1 bit start which stores the new result in each value of the loop,
the second one has a 4bit vector which stores the result to the bit on the left.
I don't know if there will be any difference in the gates used after fitting.

Alex
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…