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.

concat operator in verilog

Status
Not open for further replies.

lh-

Member level 1
Joined
Oct 5, 2016
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
277
let's say we have a 8-bit a: a[7:0]
a = {a[0], a[7:1]}

a[0] means we take the LSB, and put it in front of a[7] (MSB). then what does a[7:1] mean?
 

it means the 7 msbs of a is made into the 7 lsbs
 

i get the idea what a = {a[0], a[7:1]} does, but how does it do it? i don't get what the notation means
 

Given that this is a rotate right and a is probably supposed to be implemented as flip-flops, you shoul probably be using a non-blocking assignment (<=) instead of a blocking assignment (=).
 

i get the idea what a = {a[0], a[7:1]} does, but how does it do it? i don't get what the notation means

?!

it's a simple concatenation. it should probably be sequential though.
 

a is a bus of 8-bits. a[7:0] can be referred to as a only. Assigning something to a will assign each bit fom LSB to MSB until you run out of bits to assign or you run out of bits that ca be assigned (i.e. Verilog perfoms zero fill or truncation respectively). The {} operation make whatever signals in between the braces a new bus that is made up of the items between the braces.
 

okay, then what does this mean? -> c <= {4'b0011, 3'b101, 2'd10};
 

okay, then what does this mean? -> c <= {4'b0011, 3'b101, 2'd10};

it means c will be assigned the following bits: 9'b0011_101_10
maybe you should google verilog concatenation. this is very very VERY basic verilog.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top