verilog:part select of register

Status
Not open for further replies.

anne rachel

Junior Member level 2
Joined
Jan 11, 2011
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,435
hello all,

i have a reg [19:0]dummy,
and i have a wire [ 7:0]dumvar,
reg[3:0] ONES,TENS,HUNDREDS
assign{HUNDREDS,TENS,ONES,dumvar}=dummy;(1)
my algorithm is as follows:
if either ONES or TENS or HUNDREDS is greater or equal to 5(0101), then i must add 0011(3) to the corresponding register i.e to either ONES or TENS or HUNDREDS. i need to replace this value in the corresponding position of dummy variable and then shift the bits of dummy register to left by one position .the new dummy value should be assigned as mentioned above in (1)
Can anyone suggest me how to do this? I have tried in many ways... but still I am not getting the expected result....



Thanks in advance

- - - Updated - - -

got it !! thanks for all those who could spare few minutes to work out this....
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…