Presentation is loading. Please wait.

Presentation is loading. Please wait.

디지털 시계 설계 20432233 장성락 20432314 전영진 20432165 임종엽 20530449 전보현 20530410 이형준.

Similar presentations


Presentation on theme: "디지털 시계 설계 20432233 장성락 20432314 전영진 20432165 임종엽 20530449 전보현 20530410 이형준."— Presentation transcript:

1 디지털 시계 설계 장성락 전영진 임종엽 전보현 이형준

2 목 차 1) 과제 목적 2) 추진일정 3) 역할분담 4) 디지털 시계 구성요소 5) 소스 구성 6) 시뮬레이션 7) Q&A
9조

3 1. 과제 목적 디지털 시계 설계를 위한 알고리즘 구현 VHDL을 이용하여 디지털 시계 논리회로를 구성
기본에 충실하며 보다 독창적인 디지털시계 설계 9조

4 2. 추진 일정 구 분 1주 2주 3주 4주 자료수집 최종 결과 작성 시뮬레이션 소스구현 아이디어 회의 및 설계 계획 9조

5 3. 역할 분담 순번 학과 학년 학번 이름 역할분담 1 전자공학부 3 20432233 장성락
제안서 작성 및 stop-watch 설계 2 전영진 시간 카운터 설계 및 시스템 스뮬레이션 임종엽 자료수집 및 날짜,요일 설계 4 전보현 VHDL 시계 모드 변경 설계 5 이형준 VHDL 알람기능 설계 9조

6 4. 디지털 시계 구성요소 시계 기능 알람 기능 On / Off 기본 시계 기능 시, 분 단위로 설정 시계 변환 기능 알람
9조

7 5. 소스 구성 9조 library ieee; use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all; entity watchdec is port(clk,reset,stop,hour_in,min_in,sec_in,ahour_in,amin_in,asec_in,alarm_set : in std_logic; --시계 카운터시 사용 one_min : buffer integer range 0 to 9; one_sec : buffer integer range 0 to 9; one_hour : buffer integer range 0 to 9; ten_hour : buffer integer range 0 to 2; ten_sec : buffer integer range 0 to 5; ten_min : buffer integer range 0 to 5; --알람 카운터시 사용 aone_min : buffer integer range 0 to 9; aone_sec : buffer integer range 0 to 9; aone_hour : buffer integer range 0 to 9; aten_hour : buffer integer range 0 to 2; aten_sec : buffer integer range 0 to 5; aten_min : buffer integer range 0 to 5; bell : out std_logic); end watchdec; 9조

8 5. 소스 구성 9조 architecture main of watchdec is signal flag : std_logic;
signal alarm : std_logic; signal bell : std_logic; begin process(clk,reset,sec_in,min_in,hour_in) if(reset='1') then ten_hour <= 0; one_hour <= 0; ten_min <= 0; one_min <= 0; ten_sec <= 0; one_sec <= 0; aten_hour <= 0; aone_hour <= 0; aten_min <= 0; aone_min <= 0; aten_sec <= 0; aone_sec <= 0; flag <= '0'; 9조

9 5. 소스 구성 elsif (clk'event and clk='1') then 한클럭당 1초 클럭 발생 , 상승엣지 if( stop='1') then ten_hour<=ten_hour; Stop 하면 flag가 1이 되고 나머지 one_hour<=one_hour; 나머지 시간은 그상태로 멈춤 ten_min<=ten_min; one_min<=one_min; ten_sec<=ten_sec; one_sec<=one_sec; flag<=not flag; elsif( ten_hour = 2 and one_hour = 3 and ten_min =5 and one_min= 시 59분 59초 이면 모든시 and ten_sec=5 and one_sec = 9 and flag = '0') then 간을 0으로 ten_hour <= 0; one_hour <= 0; ten_min <= 0; one_min <= 0; ten_sec <= 0; one_sec <= 0; elsif(one_hour = 9 and ten_min =5 and one_min=9 and -- 9시 59분 59초이면 10시 00분 00초 로 설정 ten_sec=5 and one_sec = 9 and flag = '0') then ten_sec <= 0; one_sec <= 0; ten_hour <= ten_hour +1; 9조

10 5. 소스구성 elsif(ten_min <= 5 and one_min=9 and ten_sec = 5 and one_sec = 9 and flag = '0') then ten_min <= 0; 분 59초 이면 1시 00분 00초로 설정 one_min <= 0; ten_sec <= 0; one_sec <= 0; one_hour <= one_hour+1; elsif(one_min = 9 and ten_sec=5 and one_sec=9 and flag = '0') then one_min <= 0; -- 9분 59초 이면 10분 00초로 설정 ten_sec <= 0; one_sec <= 0; ten_min <= ten_min+1; elsif(ten_sec = 5 and one_sec = 9 and flag = '0') then ten_sec <= 0; 초 이면 1분으로 설정 one_min <= one_min+1; elsif(one_sec = 9 and flag = '0') then one_sec <= 0; -- 9초이면 10초로 설정 ten_sec <= ten_sec+1; elsif(flag = '0') then 초는 flag가 0이면 계속 카운트 one_sec <= one_sec+1; 9조

11 5. 소스 구성 9조 elsif( sec_in='1' and flag='1') then -- flag가 1이면 초 설정
if( ten_sec=5 and one_sec=9) then ten_sec <= 0; one_sec <= 0; elsif( one_sec=9) then ten_sec <= ten_sec+1; else one_sec <= one_sec+1; end if; elsif( min_in='1' and flag='1') then -- flag가 1이면 분 설정 if( ten_min=5 and one_min=9) then ten_min <= 0; one_min <= 0; elsif( one_min=9) then ten_min <= ten_min+1; one_min <= one_min+1; 9조

12 5. 소스 구성 9조 elsif( hour_in='1' and flag='1') then -- flag가 1이면 시 설정
if( ten_hour=2 and one_hour=3) then ten_hour <= 0; one_hour <= 0; elsif( one_hour=9) then ten_hour <= ten_hour+1; else one_hour <= one_hour+1; end if; end process; 9조

13 5. 소스 구성 process(clk,reset,sec_in,min_in,hour_in,asec_in,amin_in,ahour_in) begin if(reset='1') then reset이 1이면 alarm, bell 초기화 alarm<= '0'; bell<='0'; elsif (clk'event and clk='1') then 클럭 발생 if( alarm_set ='1' ) then alarm_set에 1이 들어오면 알람 시간 설정 가능 aten_hour<=aten_hour; 번누르면 alarm = 1 aone_hour<=aone_hour; 2번누르면 alarm = aten_min<=aten_min; aone_min<=aone_min; aten_sec<=aten_sec; aone_sec<=aone_sec; alarm<=not alarm; if(alarm='0') then end if; elsif( asec_in='1' and alarm='1') then 초설정 if( aten_sec=5 and aone_sec=9) then aten_sec <= 0; aone_sec <= 0; 9조

14 5. 소스 구성 9조 elsif( aone_sec=9) then aone_sec <= 0;
aten_sec <= aten_sec+1; else aone_sec <= aone_sec+1; end if; elsif( amin_in='1' and alarm='1') then 분설정 if( aten_min=5 and aone_min=9) then aten_min <= 0; aone_min <= 0; elsif( aone_min=9) then aone_min <= 0; aten_min <= aten_min+1; aone_min <= aone_min+1; elsif( ahour_in='1' and alarm='1') then 시설정 if( aten_hour=2 and aone_hour=3) then aten_hour <= 0; aone_hour <= 0; elsif( aone_hour = 9) then aone_hour <= 0; aten_hour <= aten_hour+1; aone_hour <= aone_hour+1; 9조

15 5. 소스 구성 9조 elsif(alarm ='1' and aten_hour=ten_hour and
aone_hour=one_hour and aten_min=ten_min and aone_min=one_min and aten_sec=ten_sec and aone_sec=one_sec)then -- 알람 식간과 현재시간이 같으면 벨 울림 bell <='1'; end if; end process; end main; 9조

16 6. 시뮬레이션 초 카운트 분 카운트 벨 울림 알람설정시 계속 시간은 흐른다 9조

17 6. 시뮬레이션 Stop Start 리셋 시간이 흐른다 9조

18 7. Q&A ? 9조


Download ppt "디지털 시계 설계 20432233 장성락 20432314 전영진 20432165 임종엽 20530449 전보현 20530410 이형준."

Similar presentations


Ads by Google