flandreas / antares

Digital circuit learning platform
49 stars 6 forks source link

Wrong decoder behaviour in flat simulation #564

Closed LuminousXLB closed 1 year ago

LuminousXLB commented 1 year ago

As in the figure below, the expected output is 7 but 1 is given.

image

Here's the script:

var val = I0 + 2 * I1 + 4 * I2
O0 = EN and val == 0
O1 = EN and val == 1
O2 = EN and val == 2
O3 = EN and val == 3
O4 = EN and val == 4
O5 = EN and val == 5
O6 = EN and val == 6
O7 = EN and val == 7

I guess the first line shall be changed to var val = 1 * I0 + 2 * I1 + 4 * I2 to cast it to number instead of bool.

flandreas commented 1 year ago

@LuminousXLB Thank you for reporting this. You are exactly right with your guess about the script. We will deliver the fix with our next release soon.

flandreas commented 1 year ago

BTW, the same bug is also in the scripts for 2-4 DEC and 4-16 DEC.