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.

Query regarding wire and reg

Status
Not open for further replies.

pratibha m d

Junior Member level 3
Joined
Mar 1, 2007
Messages
31
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,288
Activity points
1,658
Hi All,

I am not able to understand the difference b/w wire and reg when it comes to synthesis. What I understand is that, a reg stores a value when an even occurs on signals in its sensitivity list while a wire is continuously assigned.
I have come across a shift register code, a snap shot of which I have attached with this mail. The snap shot also shows the RTL view of the shift reg in which I am not able to notice the difference b/w wire and reg, and also the RTL view for ascending and descending part of the variable.
Plz help me in understanding this.



Thanks
 

The point is that you need to understand the difference between the blocking assignment and the unblocking assignment statement.

The assignment happens immediately in the blocking assignment statement. In my opinion, it blocks the other statement to execute unless it finished.

while in the unblocking assignment statement, all statement execute at the same time and the assignment happened at the end of the always statement.
 

In the snapshot u have provided there is no wire at all.
all the variables declared are reg.

when thinking of synthesis,

a wire is just a connection between two variables or signals.

say a clock signal. there is one clock port and u have to connect clock signal to all the registers. so u need a wire to connect all the registers.

so a wire cannot save or store a signal. its just a wire to connect the signals, and its not dependent on any signal. whatever comes to that wire its going to transfer.

But reg can stores a value and its fully dependent on clock and data. in the example in the snapshot he has written a code for shift register. what he is trying to explain is the dfference between bocking and non blobking statement.

if u simulate the design in modelsim,u will get the correct output but not in the case of synthesis. bcoz modelsim knows that it is a for loop and it has its own internal registers to store its intermediate varaibles, but synthesis tool will consider this as process which has to be completed in one single clock and it will assign assign the values all in one shot since there is no register to store the intermediate value.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top