BASIC4MCU | 질문게시판 | VHDL관련해서 질문드려도 될까요?
페이지 정보
작성자 김12 작성일2019-05-31 12:01 조회5,999회 댓글0건본문
ep1c6q20c8 키트를 사용해서 VHDL 코드를 구현하려고 합니다. 전체적인 코드의 길이가 있어서 다 보여드리기 어려운데ㅜㅜ 푸시버튼으로 키와 몸무게를 입력받아서 bmi를 계산한뒤 비만도에 따라 LED에 불이 들어 오려고 하는데 처음에 키와 몸무게를 001,01로 초기화 시켜줬는데 처음값은 비만삼단계(bmi지수=10000)으로 나오나 그다음 부터는 어떤값이 들어가던지 저체중이 나옵니다..ㅜㅜ if (adult='1') then -- 14 over
if (rebmi>40) then
o3<='1';
o2<='0';
o1<='0';
over<='0';
normal<='0';
under<='0';
elsif (rebmi>30) then
o3<='0';
o2<='1';
o1<='0';
over<='0';
normal<='0';
under<='0';elsif (rebmi>25) then
o3<='0';
o2<='0';
o1<='1';
over<='0';
normal<='0';
under<='0';elsif (rebmi>23) then
o3<='0';
o2<='0';
o1<='0';
over<='1';
normal<='0';
under<='0';elsif (rebmi>18) then
o3<='0';
o2<='0';
o1<='0';
over<='0';
normal<='1';
under<='0';else
o3<='0';
o2<='0';
o1<='0';
over<='0';
normal<='0';
under<='1';
end if;end if;
end if;
if (under='1') then
LED1<="10101010";
LED2<="00000000";
end if;if (normal='1') then
LED1<="00000000";
LED2<="11111111";
end if;if(over='1') then
LED1<="11111000";
LED2<="00000000";
end if;if(o1='1') then
LED1<="11111100";
LED2<="00000000";
end if;if(o2='1') then
LED1<="11111110";
LED2<="00000000";
end if;if(o3='1') then
LED1<="11111111";
LED2<="00000000";
end if;
end process;
이런식으로 작성했는데 rebmi를 초기화를 시켜줘야 할까요..?
긴 질문드려 죄송합니다ㅜㅜ
댓글 0
조회수 5,999등록된 댓글이 없습니다.