0

I want to initialize a 5-bit wire with a constant. How to do that in Verilog?

wire [4:0] master_data_out = [1'b0, 1'b1, 1'b1, 1'b0, 1'b0];

2
  • wire [4:0] master_data_out is a 5-bit wire. Commented Apr 30, 2019 at 22:06
  • 5 bit is fine. I reduced it from 64 to simplify for the question. Commented Apr 30, 2019 at 22:10

1 Answer 1

3

Maybe you are looking for

wire [4:0] master_data_out = 5'b01100;

or

wire [4:0] master_data_out = {1'b0, 1'b1, 1'b1, 1'b0, 1'b0};

BTW a simple web search would have yield that very basic concept mostlikely very quickly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.