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.

[SOLVED] help with swapping code in verilog

Status
Not open for further replies.

xpratx

Junior Member level 3
Joined
Apr 8, 2010
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
india
Activity points
1,477
hi i am trying this swap code
i define "word" as it will be input and output both but now i cannot define it as "reg" and also there comes an error in swap instruction.
is there any way around it??

i know trying input and output for "word" didn't help.

module swap(clock,word);
input clock;
inout [15:0] word;

reg [15:0] word;

always @(posedge clock)
begin
word[15:8] <= word[7:0];
word[7:0] <= word[15:8];
end
endmodule
 

Blindly writing the RTL doesn't get you anywhere. Imagine the resulting circuit before coding.
 

At a time, inout can be either in- or output. How about using dedicated in- and outputs outword[ ] <= inword[ ]?
 

Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top