Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

loop for gates in VHDL

Status
Not open for further replies.

kongruxue

Newbie level 6
Joined
Apr 13, 2012
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,406
Hi, I have a question. now there are 3 vector connect with AND gate like this:

C(3)<= A(4) and B(3)
C(2)<= A(4)and A(3)and B(2)
C(1)<= A(4)and A(3)andA(2)and B(1)
C(0)<= A(4)and A(3)andA(2)andA(1)B(0)

How can I use loop to describe it?
 

Use nested for loops for it..

Code:
for i in 0 to 3 loop
  for j in i+1 to 4 loop
    t <= a(j) and t;
 end loop;
 c(i) <= t and b(i);
end loop
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top