Apr 1, 2017 #1 L lh- Member level 1 Joined Oct 5, 2016 Messages 37 Helped 0 Reputation 0 Reaction score 0 Trophy points 6 Activity points 277 i have the following example: Code: reg A; reg[1:0] B, C; reg[2:0] D; reg[15:0] Y; A = 1'b1; B = 2'b01; C = 2'b10; D = 3'b110; Y = { 2{A}, 3{B}, C, 2{D} }; and the result is: Code: Y = 10'b 1000_1111_1010_0101 i understand that {} is the concatenation operator but how does it work here? 2{A} means 2*1 = 10, then where does the 1000 come from? or 3{B}?
i have the following example: Code: reg A; reg[1:0] B, C; reg[2:0] D; reg[15:0] Y; A = 1'b1; B = 2'b01; C = 2'b10; D = 3'b110; Y = { 2{A}, 3{B}, C, 2{D} }; and the result is: Code: Y = 10'b 1000_1111_1010_0101 i understand that {} is the concatenation operator but how does it work here? 2{A} means 2*1 = 10, then where does the 1000 come from? or 3{B}?
Apr 1, 2017 #2 V vGoodtimes Advanced Member level 4 Joined Feb 16, 2015 Messages 1,089 Helped 307 Reputation 614 Reaction score 303 Trophy points 83 Activity points 8,730 I don't think that result is correct. I get 11_010101_10_110110 = 1101_0101_1011_0110. 2{A} means "replicate A two times"
I don't think that result is correct. I get 11_010101_10_110110 = 1101_0101_1011_0110. 2{A} means "replicate A two times"
Apr 1, 2017 #3 L lh- Member level 1 Joined Oct 5, 2016 Messages 37 Helped 0 Reputation 0 Reaction score 0 Trophy points 6 Activity points 277 what i wrote was the option chosen as correct answer in a test question, i guess it's just wrong. and okay, i get it now. there's another option with your result which should be the correct result. thanks
what i wrote was the option chosen as correct answer in a test question, i guess it's just wrong. and okay, i get it now. there's another option with your result which should be the correct result. thanks