Presentation is loading. Please wait.

# 1 Statements. 2 Statements - 강의순서 ▣ 병행 (Concurrent) Statement ◈ Concurrent Signal Assignment, Simple ◈ Concurrent Signal Assignment, Conditional ◈ Concurrent.

## Presentation on theme: "1 Statements. 2 Statements - 강의순서 ▣ 병행 (Concurrent) Statement ◈ Concurrent Signal Assignment, Simple ◈ Concurrent Signal Assignment, Conditional ◈ Concurrent."— Presentation transcript:

1 Statements

2 Statements - 강의순서 ▣ 병행 (Concurrent) Statement ◈ Concurrent Signal Assignment, Simple ◈ Concurrent Signal Assignment, Conditional ◈ Concurrent Signal Assignment, Selected ◈ Process Statement ▣ 순차 (Sequential Statements) ◈ Variable Assignment & Signal Assignment Statement ◈ Wait Statement ◈ If Statement ◈ Case Statement ◈ For Loop Statement

3 Concurrent - Signal Assignment, Simple signal_name <= expression; 1) b 에 변화가 생길 때마다 b 의 값이 y 에 출력됨 2) Sensitivity List : b y <= b; y <= a or b; 1) a 나 b 에 변화가 생길 때마다 a or b 의 값이 y 에 출력됨. 2) Sensitivity List : a,b ◈ 실습 34 : 4bit parallel binary adder(pp.521)

4 Concurrent - Signal Assignment, Conditional signal <= expression1 WHEN boolean_expression1 ELSE expression2 WHEN boolean_expression2 ELSE expression3; 1) boolean_expression1= 참 (True) 이면 signal <= expression1 이 실행되며, 2) boolean_expression2= 참 (True) 이면 signal <= expression2 이 실행되며, 3) 위의 2 가지 조건이 모두 성립하지않으면 signal <= expression3 이 실행된다. ◈ 실습 35 : Priority Encoder(pp.523)

5 Concurrent - Signal Assignment, Selected WITH expression SELECT signal <= expression1 WHEN constant_value1, expression2 WHEN constant_value2, expression3 WHEN constant_value3; 1) expression = constant_value1 이면 signal <= expression1 이 실행되며, 2) expresion1 = constant_value2 이면 signal <= expression2 이 실행되며, 3) expresion1 = constant_value3 이면 signal <= expression3 이 실행된다. ◈ 실습 37 : Decoder(pp.528)

6 Concurrent – Process Statement ▣ Process 문은 하드웨어 모듈을 기술. ▣ Process 문의 내부는 순차처리. ▣ 복잡한 알고리즘의 구현 시 편리 ◈ Declaration syntax : [Label:]process [( Sensitivity List)] begin Sequential statements; end process [Label];  Sensitivity List 에 적혀있는 신호에 변화생길 때 begin 과 end process 내의 문장을 실행

7 Sequential – Variable & signal assignment statements target_signal <= expression [ after time] signal y1, y2 : std_logic; signal x : std_logic; ~ process(a, b, c, x) begin x <= a; y1 <= b and x; x <= c; y2 <= b or x; end process; end behav; target variable := expression; signal y1, y2 : std_logic; ~ process(a, b, c) variable x : std_logic; begin x := a; y1 <= b and x; x := c; y2 <= b or x; end process; end behav; ◈ 실습 25 : 4bit magnitude comparator(pp.481) ◈ 실습 26 : decoder(pp.483)

8 Sequential – Wait Statement wait on signal [, signal] wait until boolean_expression wait for time_expression (1) wait on a, b; (2) wait until ( x < 100 ); (3) wait for 10 ns; (1)a,b 에 변화가 생길 때까지 기다린다. (2)X<100 일 때까지 기다린다. (3)10ns 동안 기다린다. Suspends the sequential execution of a process or subprogram ◈ 실습 24 : D f/f with reset input (pp.478)

9 Sequential – Wait on vs. explicit sensitivity list wait on statement process begin y <= a and b; wait on a, b; end process; explicit sensitivity list process (a, b) begin y <= a and b; end process;  Process 문을 사용하는 두가지 방식 : 모두 가능함.

10 Sequential – IF Statement IF expression1 THEN statement1-1; statement1-2; ELSIF expression2 THEN statement2-1; statement2-2; ELSE statement3-1; statement3-2; END IF; 1) expression1 = 참 (True) 이면 statement1-1, state1-2 가 실행, 2) expression2 = 참 (True) 이면 statement2-1, state2-2 가 실행, 3) 위의 2 가지 조건 모두 성립하지않으면 statement3-1, state3-2 가 실행, ◈ 실습 28 : 4X1 Mux (pp.496)

11 Sequential – Case Statement CASE expression IS WHEN constant_value1 => statement1-1; statement1-2; WHEN constant_value2 => statement2-1; statement2-2; WHEN OTHERS => statement3-1; statement3-2; END CASE; 1) expression1 = constant_value1 이면 statement1-1, state1-2 가 실행, 2) expression1 = constant_value1 이면 statement2-1, state2-2 가 실행, 3) 위의 2 가지 조건 모두 성립하지않으면 statement3-1, state3-2 가 실행, ◈ 실습 31 : Encoder (pp.505)

12 Sequential – For Statement loop_label: FOR index_variable IN range LOOP statement1; statement2; END LOOP loop_label; index_variable 의 값을 변해가 면서 statement1, statement2 를 반복적으로 실행. 아래의 (a), (b) 는 모두 같은 표 현임. Range 는 downto, to 의 2 가지 형태임. loop_Start: FOR i IN 0 to 3 LOOP y(i) <= a(i) and b(i); END LOOP loop_Start; (a) y(0) <= a(0) and b(0); y(1) <= a(1) and b(1); y(2) <= a(2) and b(2); y(3) <= a(3) and b(3); (b) ◈ 실습 32 : n-input NAND gate (pp.510)

Download ppt "1 Statements. 2 Statements - 강의순서 ▣ 병행 (Concurrent) Statement ◈ Concurrent Signal Assignment, Simple ◈ Concurrent Signal Assignment, Conditional ◈ Concurrent."

Similar presentations

Ads by Google