Signal °ú Variable
±¹ÀÏÈ£
goodkook@csvlsi.kyunghee.ac.kr
http://www.csvlsi.kyunghee.ac.kr
VHDLÀÇ °´Ã¼µé·Î´Â SIGNAL, VARIABLE, Constant,±×¸®°í Loop º¯¼ö°¡ ÀÖ´Ù. SIGNAL, VARIABLE, CONSTANT´Â ¼±¾ðÇü °´Ã¼Àε¥ ºñÇØ Loop º¯¼ö´Â VHDLÀÇ FOR-LOOP¿Í °°Àº ¹Ýº¹±¸¹® ³»¿¡¼ ¼±¾ðÇÏÁö ¾Ê°í »ç¿ëÇÑ´Ù. LOOP º¯¼ö¿¡ ´ëÇؼ´Â VHDL±¸¹®À» ´Ù·ê ¶§ ¼³¸í Çϱâ·Î ÇÑ´Ù. SIGNAL°ú VARIABLE¿¡ ´ëÇÏ¿© »ìÆ캸ÀÚ. ÀÌµé µÎ °¡Áö °´Ã¼¸¦ ´ÜÀûÀ¸·Î ¸»Çϸé SIGNALÀº º´·Ä±¸¹®(concurrent statement)¿¡¼ »ç¿ëµÇ¸ç VARIABLEÀº ¼øÂ÷±¸¹®(sequential statement)¿¡¼ »ç¿ëµÇ´Â °´Ã¼ÀÌ´Ù. ¾Õ¼ ¾ð±ÞÇßµíÀÌ VHDLÀ» Æ÷ÇÔÇÑ HDLµéÀº º´·Ä±¸¹®À» ±âº»À¸·Î ÇÏ¸ç ¼øÂ÷±¸¹®À» Áö¿øÇÑ´Ù.
VHDLÀ» Æ÷ÇÔÇÑ ´ëºÎºÐ HDLÀº º´·Ä±¸¹®(concurrent statement)±âº»À¸·Î ÇÏ¸ç ¼øÂ÷±¸¹®(sequential statement)À» Áö¿øÇÑ´Ù. ÀÌ´Â µðÁöÅРȸ·Î¸¦ ³ª´ ¶§ ¼øÂ÷ȸ·Î¿Í Á¶ÇÕȸ·Î¸¦ ÀǹÌÇÏ´Â °ÍÀÌ ¾Æ´ÔÀ» ±â¾ïÇØ µÎ¾î¾ß ÇÑ´Ù. HDLÀÇ ±¸¹®»ó ±¸ºÐÀÌ´Ù. Çϵå¿þ¾î¸¦ ±â¼ú(description hardware)ÇÏ´Â °ÍÀº ¸ðµÎ º´·Ä±¸¹®ÀÌ´Ù. ÀÌ´Â Çϵå¿þ¾îÀÇ Ç¥Çö¿¡ ÀÖ¾î¼ ¿¬°á¼±(wire)À» ÀÌ¿ëÇÏ¿© AND, OR °ÔÀÌÆ®¿Í °°Àº ȸ·Î ±¸¼ºÇ°(digital primitives)ÀÇ ¿¬°áÀ» ³ªÅ¸³»´Â °ÍÀ̱⠶§¹®ÀÌ´Ù. ÀÌ·¯ÇÑ º´·Ä±¸¹® ³»¿¡ ¼øÂ÷±¸¹®À» Æ÷ÇÔÇÏ°Ô µÇ´Âµ¥ À̸¦ À§ÇÏ¿© VHDL¿¡¼´Â Ưº°È÷ PROCESS ºí·ÏÀ» »ç¿ëÇÑ´Ù. ½Ã¹Ä·¹À̼ǽà °¢ ±¸¹®ÀÌ ½ÇÇàµÉ ¶§ 1°³ÀÇ PROCESSºí·°Àº º´·Ä±¸¹® 1°³¿Í µ¿ÀÏÇÏ´Ù. VHDLÀÇ ARCHITECTURE BEGIN ~ END(ARCHITECTURE Body)ÀÇ ¸ðµç ±¸¹®Àº ±âº»ÀûÀ¸·Î º´·Ä±¸¹®À̸ç ÀÌ °÷¿¡ Ưº°È÷ PROCESS BEGIN-END°¡ ¼øÂ÷±¸¹®À» Æ÷ÇÔÇÏ°Ô µÈ´Ù. ±×¸²1Àº ARCHITECTURE³»ÀÇ º´·Ä±¸¹®°ú PROCESS ºí·ÏÀÇ º´·Ä°ü°è¸¦ Ç¥½ÃÇÑ °ÍÀÌ´Ù.
PROCESS ºí·Ï³»ÀÇ ¼øÂ÷±¸¹®ÀÌ 1°³ÀÇ º´·Ä±¸¹®°ú µî°¡ÀÓÀ» º¸¿©ÁÖ´Â ¿¹´Â ´ÙÀ½°ú °°´Ù.
SIGNAL my_signal : BIT_VECTOR(3 DOWNTO 0);
¿¡ ´ëÇÏ¿©,
PROCESS(...)
BEGIN
. . . . .
My_signal <= "0000";
My_signal(3) <= '1';
My_signal(1) <= '1';
. . . . .
END PROCESS;
¿Í °°ÀÌ PROCESS ºí·Ï ³»¿¡ Ç¥ÇöµÈ My_signal¿¡ ´ëÇÑ ÇÒ´ç¹®Àº º´·Ä±¸¹®ÀÇ,
My_signal <= "1010";
°ú µ¿ÀÏÇÏ´Ù. ±×·¯³ª º°·Ä±¸¹®À¸·Î¼
My_signal <= "0000";
My_signal(3) <= '1';
My_signal(1) <= '1';
¿Í °°Àº ÇÒ´çÀº 3 °ú 1¹ø° ºñÆ®¿¡ µðÁöÅаª '0'°ú '1'À» µ¿½Ã¿¡ ÁÖ°íÀÖ´Â ¿¡·¯ÀÌ´Ù. ¸»ÇÏÀÚ¸é ¹ö½ºÀÇ Ãæµ¹ÀÎ Ä¡¸íÀûÀÎ ¿¡·¯ÀÎ ¼ÀÀÌ´Ù. ±×·¯³ª ¼øÂ÷ºí·° PROCESS BEGIN~END¿¡¼´Â ±¸¹®ÀÇ ÃÖÁ¾ÀûÀÎ °ªÀÌ 1°³ÀÇ º´·Ä±¸¹®À¸·Î Ãë±ÞµÇ±â ¶§¹®¿¡ ¹®Á¦µÇÁö ¾Ê´Â´Ù.
ÇÁ·Î±×·¡¹Ö ¾ð¾î¿Í °°ÀÌ ¼øÂ÷±¸¹®¸¸À» ó¸®ÇÏ´Â °æ¿ì ±× ½ÇÇàÀº ±¸¹®ÀÌ ³õÀÎ ¼ø¼¿¡ ÀÇÇÑ´Ù. ±×·¯³ª HDL°ú °°ÀÌ º´·Ä±¸¹®À» ó¸®ÇÏ´Â °æ¿ì ±¸¹®ÀÇ ½ÇÇàÀ» À§Çؼ´Â ½Ã¹Ä·¹ÀÌ¼Ç Å¬·°(simulation clock)°ú À̺¥Æ® Å¥(event queue)¿Í °°Àº Ưº°ÇÑ ÀåÄ¡°¡ ÇÊ¿äÇÏ´Ù. ¸ðµç ½ÇÇàÀº ±¸¹®ÀÇ ¼ø¼°¡ ¾Æ´Ñ ½Ã¹Ä·¹ÀÌ¼Ç Å¬·°À» ±âÁØÀ¸·Î ÁøÇàµÇ´Â °Í ÀÌ´Ù. °ªÀÇ ÇÒ´ç, ½ÅÈ£ÀÇ º¯È µîÀº ¸ðµÎ À̺¥Æ® Å¥¿¡ ÀúÀåµÇ¸ç ½Ã¹Ä·¹ÀÌ¼Ç Å¬·°ÀÇ ÁøÇàÀº Å¥¿¡ ÀúÀåµÈ ¸ðµç À̺¥Æ®ÀÇ Ã³¸®°¡ ÀÌ·ç¾îÁø ÈÄ¿¡ ´ÙÀ½ 󸮷Π½Ã¹Ä·¹ÀÌ¼Ç Å¬·°À» ÁøÇàÇÑ´Ù. À̶§ ÁøÇàµÇ´Â ½Ã¹Ä·¹ÀÌ¼Ç ±âº» Ŭ·°ÀÇ °£°ÝÀ» µ¨Å¸ ½Ã°£(delta clock)À̶ó ÇÑ´Ù. º´·Ä±¸¹®°ú ¼øÂ÷±¸¹®À» ¸ðµÎ Áö¿øÇÏ´Â °æ¿ì ±¸¹®ÀÇ ¿µ¿ª±¸ºÐ, °´Ã¼ÀÇ ¼±¾ð, ÇÒ´ç µî¿¡ ´ëÇÑ ¹æ¹ýÀÌ µû·Î Á¸ÀçÇÏ°Ô µÈ´Ù.
¼øÂ÷±¸¹®°ú º´·Ä±¸¹®ÀÌ ½ÇÇàµÇ´Â °úÁ¤À» ¿¹¸¦ µé¾îº¸±â·Î ÇÏÀÚ. ´ÙÀ½°ú °°Àº µÎ º´·Ä±¸¹®,
AS <= X * Y;
BS <= AS + Z;
±×¸®°í ¼øÂ÷±¸¹®,
AV := X * Y;
BV := AV + Z;
¿¡ ´ëÇÏ¿© ½ÇÇà °úÁ¤Àº ±×¸² 2¿Í °°´Ù. º´·Ä±¸¹®¿¡¼´Â ÇöÀç ½Ã¹Ä·¹ÀÌ¼Ç Å¬·°¿¡¼ ¿¬»êÀÌ ÀÌ·ç¾î ÁøÈÄ ´ÙÀ½ÀÇ µ¨Å¸¿¡¼ ÇÒ´çÀÌ ÀÌ·ç¾îÁø´Ù(delayed assignment). ÀÌ¿¡ ¹ÝÇØ ¼øÂ÷±¸¹®¿¡¼´Â ±¸¹® ¼ø¼¿¡ µû¶ó Áï°¢ÀûÀÎ ÇÒ´çÀÌ ÀÌ·ç¾î Áø´Ù(instaneous assignment).
±×¸² 2. º´·Ä±¸¹®ÀÇ ÇÒ´ç°ú ¼øÂ÷±¸¹®ÀÇ ÇÒ´ç¹® ½ÇÇà
SIGNALÀº º´·Ä±¸¹®¿¡¼ »ç¿ëµÉ °´Ã¼ÀÇ ¼±¾ðÀÌ´Ù. µû¶ó¼ SIGNALÀº ARCHITECTURE BEGIN~END¿¡¼ Àü¿ªÀû(global)ÀÌ´Ù.
ÇÒ´ç ¿¬»êÀÚ´Â "<=" ÀÌ¸ç ¾Õ¼ ¼³¸íÇÑ °Í°ú °°ÀÌ Áö¿¬ ÇÒ´ç(delta delayed concurrent assignment)ÀÌ ÀÌ·ç¾îÁö°í 'event¿Í °°Àº ¼Ó¼ºÀ»
»ç¿ëÇÒ ¼ö ÀÖ´Ù.
VARIABLEÀº ¼øÂ÷±¸¹® ºí·Ï¿¡¼ »ç¿ëµÉ °´Ã¼ÀÇ ¼±¾ðÀ̸ç PROCESS BEGIN~END³»¿¡¼ Áö¿ªÀû(local)ÀÌ´Ù. ÇҴ翬»êÀÚ´Â ":="
ÀÌ¸ç ±¸¹®ÀÇ ¼ø¼¿¡ ÀÇ°ÅÇÏ¿© Áï½Ã ÇÒ´ç(instaneous sequential assignment)ÀÌ ÀÌ·ç¾îÁø´Ù.
SIGNAL°ú VARIABLEÀÇ ½Ã¹Ä·¹ÀÌ¼Ç ±×¸®°í ÇÕ¼ºÀ» ¿¹¸¦ µé¾î º¸µµ·Ï ÇÏ°Ú´Ù.
[¿¹Á¦ 1] SIGNAL·Î ¼±¾ðµÈ °´Ã¼°¡ ¼øÂ÷±¸¹® ºí·Ï¿¡¼ ÇÒ´çµÈ °æ¿ìÀÇ ¿¹ÀÌ´Ù. IF (clk'event AND clk='1') THEN ~ END IF; ¿¡ ÀÇÇؼ 3´ÜÀÇ Çø³-Ç÷Ó(Flip-Flop)ÀÌ µÈ´Ù. ½Ã¹Ä·¹À̼ǰú ÇÕ¼º °á°ú´Â ±×¸² 3°ú °°´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #1 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar1 IS PORT(clk : IN std_logic; din : IN std_logic_vector(2 DOWNTO 0); dout : OUT std_logic_vector(2 DOWNTO 0) ); END sigvar1; ARCHITECTURE a_sigvar1 OF sigvar1 IS SIGNAL sig0, sig1 : std_logic_vector(2 DOWNTO 0); BEGIN PROCESS (clk) BEGIN IF clk='1' AND clk'EVENT THEN sig0 <= din; sig1 <= sig0; dout <= sig1; END IF; END PROCESS; END a_sigvar1;
±×¸² 3. [¿¹Á¦ 1]ÀÇ ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú
[¿¹Á¦ 2] PROCESS BEGIN~END; ¼øÂ÷ ºí·Ï³»ÀÇ ÇÒ´çÀÇ °æ¿ìÀÌÁö¸¸ IF (clk'event AND clk='1') THEN ~ END IF; ¾È¿¡¼ ÇÒ´çÀÌ ¾Æ´Ï¸é Çø³-Ç÷ÓÀÌ ¾Æ´Ï´Ù. ¼øÂ÷±¸¹®ÀÌ °ð ¼øÂ÷ µðÁöÅРȸ·Î°¡ ¾Æ´Ñ °Í ÀÌ´Ù. ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú´Â ±×¸² 4¿Í °°´Ù. ¼øÂ÷ ±¸¹® ºí·Ï¿¡¼µµ SIGNALÀÇ ÇÒ´ç¹® ¼ø¼´Â °ü°è¾øÀÌ °¢°¢ÀÇ ÇÒ´ç¹®¿¡¼ Çø³-Ç÷ÓÀÌ Çü¼ºµÈ´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #2 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar2 IS PORT(clk : IN std_logic; din : IN std_logic_vector(2 DOWNTO 0); dout : OUT std_logic_vector(2 DOWNTO 0) ); END sigvar2; ARCHITECTURE a_sigvar2 OF sigvar2 IS SIGNAL sig0, sig1 : std_logic_vector(2 DOWNTO 0); BEGIN PROCESS (clk) BEGIN IF clk='1' AND clk'EVENT THEN sig0 <= din; -- This statement infer F/F sig1 <= sig0; -- This statement infer another F/F END IF; END PROCESS; dout <= sig1; -- "sig1" DOES NOTHING. Just Connected to "dout" END a_sigvar2;
±×¸² 4. [¿¹Á¦ 2]ÀÇ ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú
[¿¹Á¦ 3] VARIABLEÀÇ °æ¿ì ¼øÂ÷±¸¹® ÇÒ´çÀº ±¸¹®ÀÇ ¼ø¼°¡ Áß¿äÇÑ Àǹ̸¦ °®´Â´Ù. ÀÌ ¿¹Á¦¿¡¼ var0¿Í var1Àº ¼ø¼¿¡ ÀÇÇÏ¿© µî°¡ ½ÅÈ£·Î¼ Çø³ Ç÷ÓÀÌ Çü¼ºµÇÁö ¾Ê´Â´Ù. ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú´Â ±×¸² 5¿Í °°´Ù. [¿¹Á¦ 3]ÀÇ °á°ú¿Í ºñ±³ÇØ º¸ÀÚ. "din"°ú "dout"»çÀÌ¿¡ Çø³ Ç÷ÓÀÌ Çü¼ºµÈ °ÍÀ» º¼¼öÀÖ´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #4 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar4 IS PORT(clk : IN std_logic; din : IN std_logic_vector(2 DOWNTO 0); dout : OUT std_logic_vector(2 DOWNTO 0) ); END sigvar4; ARCHITECTURE a_sigvar4 OF sigvar4 IS BEGIN PROCESS (clk) VARIABLE var0, var1 : std_logic_vector(2 DOWNTO 0); BEGIN IF clk='1' AND clk'EVENT THEN var0 := din; -- These two sequential assignment DOES NOTHING! var1 := var0; -- Compare with Concurrent assignment; Example #2 and #3 dout <= var1; -- Just this statement infers F/F between "din" and "dout" END IF; END PROCESS; END a_sigvar4;
±×¸² 5. [¿¹Á¦ 3]ÀÇ ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú
[¿¹Á¦ 4] À§ÀÇ [¿¹Á¦ 3]°ú ºñ±³ÇØ º¸ÀÚ. ¼ø¼°¡ ´Ù¸¥°æ¿ì var0´Â Çø³ Ç÷ÓÀ» Çü¼ºÇÑ´Ù. ½Ã¹Ä·¹À̼ǰú ÇÕ¼ºÀÇ °á°ú´Â ±×¸² 6°ú °°´Ù. [¿¹Á¦ 2]ÀÇ °á°ú¿Í ºñ±³ÇØ º¸¸é °á±¹ °°Àº ȸ·ÎÀÌ´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #5 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar5 IS PORT(clk : IN std_logic; din : IN std_logic_vector(2 DOWNTO 0); dout : OUT std_logic_vector(2 DOWNTO 0) ); END sigvar5; ARCHITECTURE a_sigvar5 OF sigvar5 IS BEGIN PROCESS (clk) VARIABLE var0, var1 : std_logic_vector(2 DOWNTO 0); BEGIN IF clk='1' AND clk'EVENT THEN var1 := var0; -- These Two sequrntial statement infer TWO stage F/F var0 := din; -- The order of Sequential statements are very imfortant! -- Compare with Example #4 dout <= var1; -- F/F infered between "var0" and "dout" -- Another F/F is infered between "din" and "var0" END IF; END PROCESS; END a_sigvar5;
±×¸² 6. [¿¹Á¦ 4]ÀÇ ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú
[¿¹Á¦ 5] VARIABLEÀ» ¼øÂ÷±¸¹® ºí·Ï³»¿¡ Áö¿ªÀûÀÎ °´Ã¼ÀÌ´Ù. µû¶ó¼ Àü¿ªÀûÀÎ °´Ã¼ÀÎ SIGNAL·ÎÀÇ ÀÎÅÍÆäÀ̽º°¡ ÇÊ¿äÇÏ´Ù. ÀÌ ¿¹ÀÇ ½Ã¹Ä·¹À̼ǰú ÇÕ¼ºÀÇ °á°ú´Â [¿¹Á¦ 3]ÀÇ °Í°ú µ¿ÀÏÇÏ´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #6 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar6 IS PORT(clk : IN std_logic; din : IN std_logic_vector(2 DOWNTO 0); dout : OUT std_logic_vector(2 DOWNTO 0) ); END sigvar6; ARCHITECTURE a_sigvar6 OF sigvar6 IS BEGIN PROCESS (clk) VARIABLE var0, var1 : std_logic_vector(2 DOWNTO 0); BEGIN IF clk='1' AND clk'EVENT THEN var0 := din; -- Synthesized as ONE stage F/F var1 := var0; -- between "din" and "var1" END IF; dout <= var1; -- But "var1" does nothing!, connected to "dout" -- F/F infered between "din" and "dout" END PROCESS; END a_sigvar6;
[¿¹Á¦ 6] ¼øÂ÷ÀûÀÎ ÇÒ´ç¹®Àº ¸¶Áö¸· Ç×´çÀÌ ÀÌ·ç¾îÁø ÃÖÁ¾°á°ú¸¦ ÂüÁ¶ÇÑ´Ù. ÀÌ ¿¹Á¦ÀÇ ÇÕ¼º °á°ú¸¦ º¸¸é ¾Ë ¼ö ÀÖµíÀÌ HDL ÇÕ¼º±â´Â ÃÖÀûÈ °úÁ¤À» ¼öÇàÇÑ´Ù. ½Ã¹Ä·¹À̼ǰú ÇÕ¼ºÀÇ °á°ú´Â ±×¸² 7°ú °°´Ù. ±¸¹®À» Àß »ìÆ캸¸é Ãâ·Â "dout"ÀÇ 0¹ø °ú 2¹ø ºñÆ®°¡ Ç×»ó '0'À̹ǷΠÇø³ Ç÷ÓÀÌ ¸¸µé¾îÁöÁö ¾Ê´Â´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #7 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar7 IS PORT(clk : IN std_logic; din : IN std_logic_vector(3 DOWNTO 0); dout : OUT std_logic_vector(3 DOWNTO 0) ); END sigvar7; ARCHITECTURE a_sigvar7 OF sigvar7 IS BEGIN -- The diffrence of SIGNAL and VARIABLE is SIGNAL has ATTRIBUTES like 'EVENT. -- and the 'EVENT attribute infers F/F. -- A PROCESS block is regarded as a Concurrent statement -- and all concurrent statement has event drived SIGNAL! -- So, the PROCESS block without SENSITIVE LIST or WAIT statement is ERROR! PROCESS (clk) VARIABLE var0 : std_logic_vector(3 DOWNTO 0); BEGIN var0 := "0000"; -- These Three sequential statement var0(3) := '1'; -- builds Bit map "1010" var0(1) := '1'; IF clk='1' AND clk'EVENT THEN dout <= var0 AND din; END IF; END PROCESS; END a_sigvar7;
±×¸² 7. [¿¹Á¦ 6]ÀÇ ÇÕ¼º°ú ½Ã¹Ä·¹ÀÌ¼Ç °á°ú
[¿¹Á¦ 7] ¼øÂ÷±¸¹® ºí·Ï¿¡¼ SIGNALµµ ¼øÂ÷ÀûÀÎ ¼º°ÝÀ» °®´Â´Ù. [¿¹Á¦6]°ú °°Àº ÇÕ¼º°á°ú¸¦ ¾ò°ÔµÈ´Ù.
---------------------------------------------------------- -- -- Variable and Signal Synthesis Example #8 -- -- goodkook@csvlsi.kyunghee.ac.kr -- goodkook@csvlsi.kyunghee.ac.kr -- http://www.csvlsi.kyunghee.ac.kr -- ---------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY sigvar8 IS PORT(clk : IN std_logic; din : IN std_logic_vector(3 DOWNTO 0); dout : OUT std_logic_vector(3 DOWNTO 0) ); END sigvar8; ARCHITECTURE a_sigvar8 OF sigvar8 IS SIGNAL sig0 : std_logic_vector(3 DOWNTO 0); BEGIN PROCESS (clk) BEGIN sig0 <= "0000"; -- The concurrent statement in the PROCESS block sig0(3) <= '1'; -- works sequentially... sig0(1) <= '1'; -- Compare with Example #7 IF clk='1' AND clk'EVENT THEN dout <= sig0 AND din; END IF; END PROCESS; -- Following concurrent Statements cause MULTIPLE Drive ERROR! -- This region is CONCURRENT!!!!!!!!!!!!! -- sig0 <= "0000"; -- sig0(3) <= '1'; -- sig0(1) <= '1'; END a_sigvar8;