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] What does this assignment mean?

Status
Not open for further replies.

rmk423

Newbie level 4
Joined
Sep 1, 2017
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
52
Hi,


Can someone explain the below code please,

a = (b[PARAM1 : PARAM2] == c) && d.var;

Where, PARAM1 & PARAM2 are parameters (say with 1 & 2 values)


Thanks,
RMK
 

(b[PARAM1 : PARAM2] == c)
It takes the vector slice consisting of bits 2 down to 1 of element 'b' and compares it to 'c'.
With == being a Boolean operator - the result is either '0' or '1'.

&& performs a logical AND with 'd.var' and assigns the result to 'a'.
 

(b[PARAM1 : PARAM2] == c)
It takes the vector slice consisting of bits 2 down to 1 of element 'b' and compares it to 'c'.
With == being a Boolean operator - the result is either '0' or '1'.

&& performs a logical AND with 'd.var' and assigns the result to 'a'.

Just to add, d is a struct/union whose element var is accesses which is 1 bit signal as well.
 

if you under stand HDLs then b[2:1] is compared to c whose output will be either 1 or 0. Logical AND the result with d.var and then store the result into A.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top