您好我想问一下,我怎么能在VHDL中添加两个向量,其中一个是7 downto 0而另一个是8 downto 0.我试过这样的东西,但是它不起作用.先感谢您.
IS_CARRY <= '0' & (IN1 + IN2)
Run Code Online (Sandbox Code Playgroud) 我的程序中输入错误有问题.它从坐标中读取坐标并计算最大长度.它应该读到EOF.正确的坐标格式是例如[5,10].问题是,当我写"asdf"时.然后我得到4x不正确的输入,我只想要它一次.有人能帮助我吗?先感谢您.
while ((c1=(scanf(" %c %lf %c %lf %c", &f, &cx, &g, &cy, &h))) != EOF){
if (c1 != 5 || h != ']' || g != ',' || f != '['){
printf("Incorrect input. \n");
continue;
}
for (int i = 0; i < pocet; i++) {
u = polex[i] - cx;
v = poley[i] - cy;
result = sqrt((u*u) + (v*v));
if (result>max){
max = result;
}
}
printf("Max: %g\n", max);
max = 0;
}
Run Code Online (Sandbox Code Playgroud)