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.

I need verilog code of a 32 bit register

Status
Not open for further replies.

sakib

Newbie level 1
Joined
Nov 13, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
I need verilog code of 32 bit register. Can anybody help me?
 

I believe you need a verilog code of 32 bit shift register.

If so, then I believe the below code will suit you ( just please notice that the code I wrote just for your replay it is not tested )

module shiftreg ( out, clock, in reset);
input in, clock,reset;
output[0:31] out;
reg [0:31] out_nxt;

assign out = out_nxt;

always@ (posedge clock)
begin
if (reset)
out_nxt <= 32`b0;
else
out_nxt = {out_nxt, in};
end

endmodule

Please feel free to add any comments that you might have connected with this code.
 

Nice, everythime someone talks about a register, we replace with shift-register :)

The problem with this kind of "shift" register code is that there is no synchronisation available, when do you know 32 bits are loaded? Do you need to shift every clock edge? Maybe he's looking for shifing out instead of shifing in? Left or right shift?... I think too much parameters are left open for the moment, especially if it needs shifting in the first place.
 

I need verilog code of 32 bit register. Can anybody help me?

Code:
reg [31:0] a_thirty_two_bit_register; // there you go, a 32 bit register

Well, that was easy! :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top