初学者求助啊!大家帮帮我啊!
1. 写一个IF描述语句,当整数n为奇数时,变量odd为‘1’;当n为偶数时,odd为‘0’。
2.写一个case描述语句,去除standard_logic变量x的强度信息。如果x为‘0’或’L’,将其设为‘0’;如果x是‘1’或‘H’,设为‘1’;如果x是‘X’,‘W’,‘Z’,‘U’或‘-’,则设为‘X’。
都要用VHDL编写,我写的程序好多错误啊!麻烦高手们写下完整的程序 本帖最后由 hng1123 于 2011-4-9 14:45 编辑
IF(n/2 == 0)
odd :=1;
else
odd :=1
end if; case x
when '0'or'L'=>x <='0';
when '1'or'H'=>x <='1';
when 'Z'or'X'or'W'or'U'or'-'=>x <='X';
when others => null;
end case;
页:
[1]