Microsoft PowerPoint - M01_VerilogHDL01.ppt [호환 모드]

Size: px
Start display at page:

Download "Microsoft PowerPoint - M01_VerilogHDL01.ppt [호환 모드]"

Transcription

1 Verilog HDL 을이용한디지털시스템설계및실습 1. Verilog HDL 개요 Ver1.0 (2008)1

2 Verilog HDL 의역사 Verilog HDL 1983 년 Gateway Design Automation 사에서하드웨어기술언어인 HiLo 와 C 언어의특징을기반으로개발 1991 년 Cadence Design Systems 가 Open Verilog International (OVI) 라는조직을구성하고 Verilog HDL 을공개 1993 년 IEEE Working Group 이구성되어표준화작업을진행 1995 년 12 월 IEEE Std 로표준화 2001 년에 IEEE Std 로개정 Verilog HDL 의확장형태인 SystemVerilog 가개발되어 IEEE 표준화를추진 Ver1.0 (2008)2

3 Verilog 어휘규칙 어휘토큰 (lexical tokens) 여백 (white space) 주석 (comment) 연산자 (operator) 수 (number) 문자열 (string) 식별자 (identifier) 키워드 (keyword) Ver1.0 (2008)3

4 Verilog 어휘규칙 여백 (white space) 빈칸 (space), 탭 (tab), 줄바꿈 어휘토큰들을분리하기위해사용되는경우를제외하고는무시 공백 (blank) 과탭은문자열에서의미있게취급 주석 (comment) HDL 소스코드의설명을위해사용되며, 컴파일과정에서무시됨 단일라인주석문 ; // 로시작되어해당라인의끝까지 블록주석문 ; /* ~ */ 로표시 블록주석문은내포 (nested) 될수없음 연산자 (operator) 단항연산자, 2 항연산자, 3 항연산자 Ver1.0 (2008)4

5 Verilog 어휘규칙 수표현 (number representation) 정수형 (integer) ; 10 진수,16 진수,8 진수,2 진수 형식 : [size_constant]'<base_format> <number_value> [size_constant]: 값의비트크기를나타내는상수 0이아닌unsigned 10진수가사용되며, 생략될수있음 unsized 수 ( 즉, 단순 10 진수또는비트크기가지정되지않은수 ) 는 32비트로표현됨 상위비트가 x(unknown) 또는 z(high-impedance) 인 unsized unsigned 상수는그상수가사용되는수식의비트크기만큼확장됨 'base_format : 밑수 (base) 를지정하는문자 (d, D, h, H, o, O, b, B) signed를나타내기위해문자 s 또는 S가함께사용될수있음 number_value : unsigned 숫자를사용하여값을표현 'base_format 에적합한숫자들로구성 base_format 과 number_value 사이에 + 또는 - 부호사용불가 Ver1.0 (2008)5

6 Verilog 어휘규칙 수표현 (number representation) 비트크기와밑수를갖지않는단순 10 진수는 signed 정수로취급 부호지정자없이밑수만지정되면 unsigned 정수로취급 밑수지정자와부호지정자 s가함께사용되면 signed 정수로취급 부호지정자 s는비트패턴에는영향을미치지않으며, 비트패턴의해석에만영향을미침 음수는 2의보수 (2 s complementary) 형식으로표현됨 지정된비트크기보다 unsigned 수의크기가작은경우 MSB 왼쪽에 0 이삽입 MSB 가 x 또는 z 이면, x 또는 z 가왼쪽에삽입 값에물음표 (? ) 가사용되면 z로취급 첫번째문자를제외하고는밑줄 (underscore) 이사용될수있으며, 이는수의가독성 (readability) 을좋게함 Ver1.0 (2008)6

7 Verilog 어휘규칙 Number # of Bits Base Dec. Equiv. Stored Decimal b10 2 Binary d5 3 Decimal o5 8 Octal ha 8 Hex b5 Invalid! 3 b01x 3 Binary - 01x 12 hx 12 Hex - xxxxxxxxxxxx 8 b0000_ Binary bx01 8 Binary - xxxxxx01 bz Unsized Binary - zz...zz(32bits) 8 HAD 8 Hex Ver1.0 (2008)7

8 Verilog 어휘규칙 659 // a decimal number 'h837ff // a hexadecimal number 'o7460 // an octal number 4af // illegal (hexadecimal format requires 'h) 4'b1001 // a 4-bit binary number 5'D3 // a 5-bit decimal number 3'b01x // a 3-bit number with the LSB unknown 12'hx // a 12-bit unknown number 16'hz // a 16-bit high-impedance number Ver1.0 (2008)8

9 Verilog 어휘규칙 8'd-6 // illegal syntax -8'd6 // this defines the two s complement of -6, // held in 8 bits, equivalent to -(8'd6) 4'shf // this denotes the 4-bit number '1111', to // be interpreted as a 2's complement number, // or '-1'. This is equivalent to -4'h1-4'sd15 // this is equivalent to -(-4'd1), or '0001' -'d12 // 'sd12 // _195_000 16'b0011_0101_0001_ 'h 12ab_f001 Ver1.0 (2008)9

10 Verilog 어휘규칙 reg [11:0] a, b, c, d; initial begin a = 'hx; // yields xxx b = 'h3x; // yields 03x c = 'hz3; // yields zz3 d = 'h0z3; // yields 0z3 end Ver1.0 (2008) 10

11 Verilog 어휘규칙 실수형 (real) ; IEEE Std (IEEE standard for doubleprecision floating-point number) E e-2 0.1e-0 29E _763_e-12 (underscores are ignored) E3.2e-7 문법적오류 Ver1.0 (2008) 11

12 Verilog 어휘규칙 문자열 (string) 이중인용부호 ( ) 사이에있는일련의문자들 단일라인에존재해야하며, 여러라인에걸친문자열은사용불가 8 비트 ASCII 값으로표현되는 unsigned 정수형상수로취급 문자열변수는 reg 형의변수이며, 문자열내의문자수에 8 을곱한 크기의비트폭을가짐 reg [8*12:1] string_var; initial begin string_var = "Hello world!"; end Ver1.0 (2008) 12

13 Verilog 어휘규칙 module string_test; reg [8*14:1] stringvar; initial begin stringvar = "Hello world"; $display("%s is stored as %h", stringvar, stringvar); stringvar = {stringvar,"!!!"}; $display("%s is stored as %h", stringvar, stringvar); end endmodule Hello world is stored as c6c6f20776f726c64 Hello world!!! is stored as 48656c6c6f20776f726c Ver1.0 (2008) 13

14 Verilog 어휘규칙 특수문자앞에확장문자 (escaped character) 를사용하면일부 특수문자를문자열에포함시킬수있음 확장문자를이용한특수문자의표현 확장문자열 확장문자열에의해생성되는특수문자 \n New line character \t Tb Tab character \\ \ character \" " character \ddd A character specified in 1~3 octal digits (0 d 7) Ver1.0 (2008) 14

15 Verilog 어휘규칙 식별자 (identifier) 객체에고유의이름을지정하기위해사용 대소문자를구별하여인식 가독성을위해밑줄사용가능 단순식별자 ; 일련의문자, 숫자, 기호 $, 밑줄등으로구성 첫번째문자는숫자나기호 $ 사용불가, 문자또는밑줄만사용 확장식별자 (escaped identifier); \ (back slash) 로시작되며, 여백 ( 빈칸, 탭, 줄바꿈 ) 등으로끝남 프린트가능한 ASCII 문자들을식별자에포함시키는수단을제공 키워드 (keyword) Verilog 구성요소를정의하기위해미리정의된식별자 확장문자가포함된키워드는키워드로인식되지않음 Ver1.0 (2008) 15

16 Verilog 어휘규칙 shiftreg_a busa_index error_condition merge_ab _bus3 n$657 유효한식별자의예 \busa+index \-clock \***error-condition*** \net1/\net2 \{a,b} \a*(b+c) Ver1.0 (2008) 16

17 Verilog 어휘규칙 Verilog keyword ( 일부 ) always if release and ifnone repeat assign incdir rnmos automatic include rpmos begin buf bufif0 bufif1 case casex casez cell cmos config deassign default defparam design initial inout input instance integer join large liblist library localparam macromodule medium module nand rtran rtranif0 rtranif1 scalared showcancelled signed small specify specparam strong0 strong1 supply0 supply1 table disable edge else end endcase negedge nmos nor not notif0 task time tran tranif0 tranif1 Ver1.0 (2008) 17

18 Verilog HDL 개요 Verilog HDL 논리합성 assign, if~else, case, for always specify $width table Simulation initial, $finish $fopen Library Verilog HDL 구문 Ver1.0 (2008) 18

19 Verilog HDL 의모듈 module module_name (port_list); Semicolon port 선언 reg 선언 wire 선언 parameter 선언 하위모듈호출 always, initial 문 function, task 정의문 assign 문 function, task 호출문 endmodule No Semicolon Ver1.0 (2008) 19

20 Verilog HDL 의모듈 wire, reg wire wire input inout output wire Module_instance_A wire wire wire wire, reg Primitive instantiation wire wire, reg Module_instance_B wire, wire reg wire Continuous assignment assign wire_a = C D; reg reg_a, reg_b,... integer int_a,... always begin... end declarations Behavior_1 register variables initial begin... end Behavior_2 Ver1.0 (2008)

21 Verilog 모델링예 게이트프리미티브를이용한모델링예 ( 반가산기회로 ) Module Name Module Ports module half_add1 add1 (a, b, sum, cout); input a, b; output sum, cout; Declaration of wire cout_bar; port modes a b cout sum xor (sum, a, b); nand (cout_bar, a, b); not (cout, cout_bar); endmodule Declaration of internal signals a b Half_ Adder sum = a ^ b cout = a&b sum cout Verilog keyword Instantiation of Primitive gates Ver1.0 (2008) 21

22 Verilog 모델링예 연속할당문을이용한모델링 module half_adder2(a, b, sum, cout); input a, b; output sum, cout; assign cout = a & b; assign sum = a ^ b; endmodule Ver1.0 (2008) 22

23 Verilog 모델링예 행위수준모델링 ( 조합논리회로 ) module mux2b_if(in0, in1, sel, out); input [1:0] in0, in1; input sel; output [1:0] out; reg [1:0] out; or in0 or in1) begin if (sel ==0) out = in0; else out = in1; end endmodule in0 in1 2 2 MUX sel 2 out Ver1.0 (2008) 23

24 Verilog 모델링예 행위수준모델링 ( 순차회로 ) module flip-flop (q, din, clk, rst); input din, clk, rst; output q; reg q; clk or posedge rst) begin if (rst == 1) q <= 0; else q <= din; end endmodule Ver1.0 (2008) 24

25 Verilog 모델링예 하위모듈인스턴스를이용한구조적모델링 module full_add (a, b, cin, sum, cout); input a, b, cin; output sum, cout; wire w1, w2, w3; // 생략가능 half_add1 U1 (a, b, w1, w2); half_add2 add2 U2 (w1, cin, sum, w3); or U3 (cout, w2, w3); endmodule Module instantiation Ver1.0 (2008) 25

26 Verilog 모델링예 테스트벤치모듈 HDL 모델을시뮬레이션하기위한 Verilog 모듈 DUT 에인가될시뮬레이션입력 (stimulus) 을생성하는구문 시뮬레이션대상이되는모듈 (Design Under Test; DUT) 의인스턴스 시뮬레이션입력에대한 DUT 의반응 (response) 을관찰하는구문 Stimulus Generator Design Under Test (DUT) Response Monitor Ver1.0 (2008) 26

27 Verilog 모델링예 module test_fix (); reg A, B, C; Verilog Testbench 예 end endmodule circuit c1(a, B, C, Out); // DUT initial begin A=0; B=1; C=0; #50 A=1; #50 A=0; C=1; #50 C=0; #50 $finish; Ver1.0 (2008) 27

28 Verilog 모델링예 module tb_ha ; reg a, b; 반가산기의테스트벤치예 half_adder U0_half_adder(a, b, sum, cout); initial begin a = 0; b = 0; #10 a = 1; #10 a = 0; b = 1; end endmodule #10 a = 1; #10 a = 0; b = 0; Ver1.0 (2008) 28

29 Verilog 모델링예 module tb_dff_sr ; reg set, reset, clock, din; D 플립플롭의테스트벤치예 dff_sr U0_dff_sr (set, reset, clock, din, q, qb); initial begin clock = 1'b0; forever begin #10 clock = ~clock; end end initial begin forever begin din = 0; reset = 1; set = 1; #15 din = 1; #30 reset = 0; #10 reset = 1; #25 din = 0; #20 set = 0; #10 set = 1; #30 din = 0; end end endmodule Ver1.0 (2008) 29

30 Verilog HDL 을이용한디지털시스템설계및실습 2. 자료형과연산자 Ver1.0 (2008) 30

31 2.1.1 Verilog 의논리값 표 2.1 Verilog 의논리값집합 논리값 의미 0 logic zero, or false condition 1 logic one, or true condition x z unknown logic value high-impedance state Ver1.0 (2008) 31

32 2.1.1 Verilog 의논리값 Zero, low, false, logic low, ground, 0 VSS One, high, true, logic high, power, 1 VDD, VCC X, unknown : occurs at logical conflict which cannot be resolved x HiZ, high impedence, tri-stated, disabled or disconnected driver z 0 Ver1.0 (2008) 32

33 Verilog HDL 의자료형 Net 자료형 : 소자간의물리적인연결을추상화 wire, tri, wand, wor, triand, trior, supply0, supply1, tri0, tri1, trireg Default 자료형 ; 1비트의 wire Variable 자료형 : 절차형할당문사이의값의임시저장 프로그래밍언어의 variable 과유사한개념 reg, integer, real, time, realtime net 자료형과 variable 자료형의할당모드 할당모드 자료형 프리미티브출력 연속할당문 절차형할당문 assign deassign PCA force release PCA Net Yes Yes No No Yes Variable Comb (No) Seq (Yes) No Yes Yes Yes * PCA : Procedural Continuous Assignment Ver1.0 (2008) 33

34 2.1.2 net 자료형 net 자료형 논리게이트나모듈등의하드웨어요소들사이의물리적연결을 나타내기위해사용 연속할당문 (continuous assignment), 게이트프리미티브등과 같은구동자 (driver) 의값에의해 net 의값이연속적으로유지됨 값을저장하지않음 ( 단, trireg net 는예외 ) 구동자가연결되지않으면, default 값인 high-impedance (z) 가됨 단, trireg net 는이전에구동된값을유지 default 자료형은 1 비트의 wire default 초기값은 z trireg net 는 default 초기값으로 x 를가짐 Ver1.0 (2008) 34

35 2.1.2 net 자료형 표 2.2 Verilog net 자료형 자료형이름 wire tri wand wor triand trior supply0 supply1 tri0 tri1 trireg 의미 함축된논리적동작이나기능을갖지않는단순한연결을위한 net 함축된논리적동작이나기능을갖지않는단순한연결을위한 net 이며, 하드웨어에서 3 상태 (tri-state) 가되는점이 wire 와다름 다중구동자를갖는 net 이며, wired-and ( 즉, open collector logic) 의하드웨어구현을모델링하기위해사용 다중구동자를갖는 net이며, wired-or ( 즉, emitter coupled logic) 의하드웨어구현을모델링하기위해사용 wand 와동일하게다중구동자를갖는 net 이며, 하드웨어에서 3 상태 (tri-state) 를갖는점이다름 wor 와동일하게다중구동자를갖는 net 이며, 하드웨어에서 3 상태 (tri-state) 를갖는점이다름 회로접지 (circuit ground) 에연결되는 net 전원 (power supply) 에연결되는 net 저항성 pulldown (resistive pulldown) 에의해접지로연결되는 net 저항성 pullup (resistive pullup) 에의해전원으로연결되는 net 물리적인 net 에저장되는전하를모델링하는 net Ver1.0 (2008) 35

36 2.1.2 net 자료형 wire w1, w2; // declares two wires, 생략가능 wire [7:0] bus; // a 8-bit bus wire enable=1'b0; // wire with initial value of 0 wand w3; // a scalar net of type wand tri [15:0] busa; // a three-state 16-bit bus Ver1.0 (2008) 36

37 2.1.2 net 자료형 wire와 tri 회로구성요소들사이의연결에사용 wire : 단일게이트또는단일연속할당문에의해구동되는 net에사용 tri : 3상태 net에사용 표 2.3 wire, tri net 의진리표 wire/tri 0 1 x z 0 0 x x 0 1 x 1 x 1 x x x x x z 0 1 x z Ver1.0 (2008) 37

38 2.1.2 net 자료형 wired net 다중구동자를갖는설계를지원하기위해사용 표 2.4 wand, triand net 의진리표 표 2.5 wor, trior net 의진리표 wand/ triand 0 1 x z wor/ trior 0 1 x z x 1 x 0 x x x z 0 1 x z x x x 1 x x z 0 1 x z Ver1.0 (2008) 38

39 2.1.2 net 자료형 module wand_ex ; reg a, b, c; wire w_nor, w_buf, w_wire; wand w_wand; wand; 코드 2.1 initial begin a=0; b=0; c=0; #50 a=1; b=1; 시뮬레이션결과 end nor(w_nor, a, b); buf(w_buf, c); nor(w_wire, a, b); buf(w_wire, c); nor(w_wand, a, b); buf(w_wand, c); endmodule Ver1.0 (2008) 39

40 2.1.2 net 자료형 tri0 와 tri1 tri0 : 저항성 pull-down 에의해접지로연결되는 net 에사용 구동자에의해구동되지않으면 net 의값은 0 tri1 : 저항성 pull-up p 에의해전원으로연결되는 net 에사용 구동자에의해구동되지않으면 net 의값은 1 표 2.6 tri0 net 의진리표 표 2.7 tri1 net 의진리표 tri0 0 1 x z 0 0 x x 0 1 x 1 x 1 x x x x x z 0 1 x 0 tri1 0 1 x z 0 0 x x 0 1 x 1 x 1 x x x x x z 0 1 x 1 Ver1.0 (2008) 40

41 2.1.3 variable 자료형 variable 자료형 ; reg, integer, real, time, realtime 절차적할당문 (procedural assignment) 의실행에의해그값이 바뀌며, 할당에서부터다음할당까지값을유지 default 초기값 reg, time, integer 자료형 : x (unknown) real, realtime 자료형 : 0.0 variable 이음의값을할당받는경우, signed reg, integer, real, realtime 자료형 : 부호를유지 unsigned reg, time 자료형 : unsigned 값으로취급 Ver1.0 (2008) 41

42 2.1.3 variable 자료형 reg 절차적할당문에의해값을받는객체의자료형 할당사이의값을유지 하드웨어레지스터를모델링하기위해사용될수있음 edge-sensitive ( 플립플롭등 ) 와 level-sensitive ( 래치등 ) 의저장소자들을모델링할수있음 reg는조합논리회로의모델링에도사용되므로, reg가항상하드웨어적인저장소자를의미하지는않음 reg a; // a scalar reg reg[3:0] v; // a 4-bit vector reg made up of(from most to // least significant) v[3], v[2], v[1], and v[0] reg signed [3:0] signed_reg; // a 4-bit vector in range -8 to 7 reg [-1:4] b; // a 6-bit vector reg reg [4:0] x, y, z; // declares three 5-bit regs Ver1.0 (2008) 42

43 2.1.3 variable 자료형 module dff (clk, d, q); module mux21_if(a, b, sel, out); input d,clk; input [1:0] a, b; output q; input sel; reg q; output [1:0] out; reg [1:0] out; clk) q <= d; endmodule D 플립플롭 or b or sel) if(sel == 1'b0) out = a; else out = b; endmodule 2 : 1 MUX Ver1.0 (2008) 43

44 2.1.3 variable 자료형 integer 자료형 정수형값을취급하며, 절차적할당문에의해값이변경됨 signed reg 로취급되며, 연산결과는 2 의보수가됨 time 자료형 시뮬레이션시간을처리하거나저장하기위해사용됨 64 비트의 reg 와동일하게작용 unsigned 값이고 unsigned 연산이이루어짐 real, reatime 자료형 실수형값을취급 integer a; // integer value time last_chng; // time value real float ; // a variable to store real value realtime rtime ; // a variable to store time as a real value Ver1.0 (2008) 44

45 2.1.4 벡터 벡터 범위지정 [msb:lsb] b] 을갖는다중비트의 net 또는 reg 자료형 signed 로선언되거나 signed 로선언된포트에연결되는경우를 제외하고는 unsigned 로취급 단일할당문으로값을받을수있음 data_type [msb:lsb] identifier; reg [7:0] rega; // 8-bit reg wire [15:0] d_out; // 16-bit wire Ver1.0 (2008) 45

46 2.1.5 배열 배열 별도의자료형이없으며, reg 또는 wire 선언을이용하여선언 배열전체또는일부분은단일할당문에의해값을할당받을수 없으며, 또한수식에사용될수없음 배열을구성하는 element 만단일할당문으로값을할당받을수있음 RAM, ROM, Register File 등의메모리모델링에사용 2 차원배열 data_type t identifier [Uaddr:Laddr][Uaddr2:Laddr2]; L 2] 벡터의 1 차원배열 data_type [msb:lsb] identifier [Uaddr:Laddr][Uaddr2:Laddr2]; Ver1.0 (2008) 46

47 2.1.5 배열 reg [7:0] mema[0:255]; // a memory mema of bit registers reg arrayb[7:0][0:255]; // a 2-D array of 1-bit registers wire w_array[7:0][5:0]; // an array of wires integer inta[1:64]; // an array of 64 integer values time chng_hist[1:1000]; // an array of 1000 time values mema = 0; // Illegal syntax- Attempt to write to entire array arrayb[1] = 0; // Illegal Syntax - Attempt to write to elements // [1][0]..[1][255] arrayb[1][12:31] = 0; // Illegal Syntax - Attempt to write to // elements [1][12]..[1][31] mema[1] = 0; // Assigns 0 to the second element of mema arrayb[1][0] = 0; // Assigns 0 to the bit referenced by indices [1][0] inta[4] = 33559; // Assign decimal number to integer in array chng_hist[t_index] = $time; // Assign current simulation time to // element addressed by integer index Ver1.0 (2008) 47

48 2.1.5 배열 메모리 reg형요소를갖는 1차원배열 메모리전체가단일할당문으로값을할당받을수없음 인덱스로지정되는워드단위로만값을할당하거나수식에사용될수있음 reg [1:n] rega; // An n-bit register reg mema [1:n]; // A memory of n 1-bit registers Ver1.0 (2008) 48

49 2.1.6 parameter parameter variable 또는 net 범주에속하지않는상수값 회로의비트크기또는지연값을지정하기위해사용 defparam 문또는모듈인스턴스문의 parameter overriding 에의해값을 변경시킬수있음 자료형과범위지정을가질수있음 범위가지정되지않은경우, 상수값에적합한크기의비트폭을 default 로가짐 parameter msb = 7; // defines msb as a constant value 7 parameter e = 25, f = 9; // defines two constant numbers parameter r = 5.7; // declares r as a real parameter parameter byte_size = 8, byte_mask = byte_size - 1; parameter average_delay =(r + f) / 2; parameter signed [3:0] mux_selector = 0; parameter real r1 = 3.5e17; parameter p1 = 13'h7e; parameter [31:0] dec_const const = 1'b1; // value converted to 32 bits parameter newconst = 3'h4; // implied range of [2:0] Ver1.0 (2008) 49

50 2.1.6 parameter module modxnor (y_out, a, b); parameter size=8, delay=15; output [size-1:0] y_out; input [size-1:0] a, b; wire [size-1:0] #delay y_out= a ~^ b; // bit-wise XNOR endmodule 모듈인스턴스의 parameter overriding module Param; wire [7:0] y1_out; wire [3:0] y2_out; reg [7:0] b1, c1; reg [3:0] b2, c2; modxnor G1 (y1_out, b1, c1); // use default parameters modxnor #(4, 5) G2 (y2_out, b2, c2); // overrides default parameters endmodule // Primitive instantiation with 3 units of delay nand #3 G1 (out _ nd2, in0, in1); primitive gate 의 delay Ver1.0 (2008) 50

51 2.2 Verilog 의연산자 표 2.8 Verilog HDL 의연산자 연산자기능연산자기능 {}, {{}} 결합, 반복 ^ 비트단위 exclusive or +, -, *, /, ** 산술 ^~ 또는 ~^ 비트단위 xnor % 나머지 & 축약 and >, >=, <, <= 관계 ~& 축약 nand! 논리부정 축약 or && 논리 and ~ 축약 nor 논리 or ^ 축약 xor == 논리등가 ^~ 또는 ~^ 축약 xnor!= 논리부등 << 논리왼쪽시프트 === case 등가 >> 논리오른쪽시프트!== case 부등 <<< 산술왼쪽시프트 ~ 비트단위부정 >>> 산술오른쪽시프트 & 비트단위 and? : 조건 비트단위 inclusive or or Event or Ver1.0 (2008) 51

52 2.2 Verilog 의연산자 표 2.9 실수형수식에사용될수있는연산자 연산자기능연산자기능 +, -, *, /, ** 산술 논리 or +, - 부호 == 논리등가 >, >=, <, <= 관계!= 논리부등! 논리부정? : 조건 && 논리 and or Event or Ver1.0 (2008) 52

53 2.2 Verilog 의연산자 표 2.10 Verilog 연산자의우선순위 +, -,!, ~ ( 단항 ) Highest precedence ** *, /, % +, -( 이항 ) <<, >>, <<<, >>> <, <=, >, >= ==,!=, ===,!== &, ~& ^, ^~, ~^, ~ &&? : (conditional operator) Lowest precedence Ver1.0 (2008) 53

54 2.2 Verilog 의연산자 integer IntA, IntB, IntC, IntD; IntA = -12 / 4; // The result is -3. IntB = -'d12 / 4; // The result is IntC = -'sd12 / 4; // The result is -3. IntD = -4'sd12 / 4; // -4'sd12 is the negative of the 4-bit 1100, // which is -4. -(-4) = 4. The result is 1. Ver1.0 (2008) 54

55 2.2.1 산술연산자 피연산자의비트에 x (unknown) 나 z (high-impedance) 가포함된경우에는전체결과값은 x가됨 나누기와나머지연산자에서두번째피연산자가 0인경우, 결과값은 x가됨 나머지연산자의결과값은첫번째피연산자의부호를따름 거듭제곱연산자에서다음의경우에는결과값이정의되지않음 첫번째피연산자가 0 이고두번째피연산자가양수가아닌경우 첫번째피연산자가음수이고두번째피연산자가정수값이아닌경우 표 2.11 산술연산자 기호 기능 + 더하기 - 빼기 * 곱하기 / 나누기 ( 몫 ) % 나머지 (modulo) ** 거듭제곱 (power) Ver1.0 (2008) 55

56 2.2.1 산술연산자 표 2.12 나머지연산자의연산결과 수식결과값설명 10 % 을 3 으로나눈나머지는 1 11 % 을 3 으로나눈나머지는 2 12 % 를 3 으로나눈나머지는 0-10 % 3-11 결과값은첫번째피연산자의부호를따름 11 % -3 2 결과값은첫번째피연산자의부호를따름 Ver1.0 (2008) 56

57 2.2.1 산술연산자 unsigned net signed net unsigned reg signed reg integer time 표 2.13 산술연산자에서의자료형해석 자료형 Unsigned 해석 Signed, 2 s complement Unsigned Signed, 2 s complement Signed, 2 s complement Unsigned real, realtime Signed, floating-point i t Ver1.0 (2008) 57

58 2.2.1 산술연산자 integer inta; reg [15:0] rega; reg signed [15:0] regs; inta = -4'd12; rega = inta / 3; // 결과값은 -4 // inta는 integer 자료형이고, rega는 rega = -4'd12; // rega는 inta = rega / 3; // 결과값은 inta = -4'd12 / 3; // 결과값은 // -4d'12는 32-bit reg 자료형 rega = -12 / 3; // 결과값은 -4, -12는 integer 자료형 // rega 는 regs = -12 / 3; // 결과값은 -4. regs는 signed reg regs = -4'sd12 / 3; // 결과값은 1. -4'sd12는실제로 4이므로 // 정수나눗셈규칙에의해 4/3=1 이된다. Ver1.0 (2008) 58

59 2.2.2 관계연산자 산술연산자보다낮은우선순위를가짐 피연산자의비트에 x (unknown) 나 z(high-impedance) impedance) 가포함된경우에는 결과값은 1비트의 x가됨 두피연산자의비트수가다른경우에는, 비트수가작은피연산자의 MSB 쪽에 0이채워져비트수가큰피연산자에맞추어진후, 관계를판단함 피연산자중하나가실수형이면다른피연산자가실수형으로변환된후, 비교됨 표 2.14 관계연산자 관계연산자식의미 a < b a 가 b 보다작다 a > b a 가 b 보다크다 a <= b a 가 b 보다작거나같다 a >= b a 가 b 보다크거나같다 Ver1.0 (2008) 59

60 2.2.2 관계연산자 // A = 9, B = 4 // D = 4'b1001, E = 4'b1100, F = 4'b1xxx A <= B // 결과값은거짓 (0) A > B // 결과값은참 (1) E >= D // 결과값은참 (1) E < F // 결과값은 x l a < b-1 // l과 2는결과가동일 2 a <(b-1) 3 b-(1 < a) // 3과 4는결과가다를수있음 4 b-1 < a Ver1.0 (2008) 60

61 2.2.3 등가연산자 관계연산자보다낮은우선순위를가짐 피연산자의비트끼리비교 두피연산자의비트수가다른경우에는, 비트수가작은피연산자의 MSB 쪽에 0이채워져비트수가큰피연산자에맞추어진후, 등가를판단함 case equality 와 case inequality 연산자 (===,!==) 는대부분의 EDA 툴에서논리합성이지원되지않으므로, 합성을위한 RTL 수준의모델링에는 사용하지않는것이좋음 표 2.15 등가연산자 관계연산자식의미 a === b a 와 b 는같다. (x 와 z 가포함된일치를판단 ) a!== b a 와 b 는같지않다. (x 와 z 가포함된불일치를판단 ) a == b a 와 b 는같다. ( 결과가 x 가될수있음 ) a!= b a 와 b 는같지않다. ( 결과가 x 가될수있음 ) Ver1.0 (2008) 61

62 2.2.3 등가연산자 // A = 9, B = 4 // D = 4'b1001, E = 4'b1100 // F = 4'b1xxz, G = 4'b1xxz, H = 4'b1xxx A === B // 결과값은거짓 (0) D!= E // 결과값은참 (1) D == F // 결과값은 x F === G // 결과값은참 (1) F === H // 결과값은거짓 (0) G!== H // 결과값은참 (1) Ver1.0 (2008) 62

63 2.2.4 논리연산자 참또는거짓의판단이모호한경우에는결과값은 x 논리연산자식의미 a && b a b a 와 b 의논리 AND a 와 b 의논리 OR!a a 의부정 (NOT a) // A = 3, B = 0, C = 2'b0x, D = 2'b10인경우에, A && B // 결과값은 0 A B // 결과값은 1!A // 결과값은 0!B // 결과값은 1 C && D // 결과값은 x Ver1.0 (2008) 63

64 2.2.4 논리연산자 // alpha = 237, beta=0 인경우에, rega = alpha && beta; // rega 에는 0 이할당된다. regb = alpha beta; // regb 에는 1 이할당된다. a < size-1 && b!= c && index!= last_one (a < size-1) && (b!= c) && (index!= last_one) // recommended if(!reset) Ver1.0 (2008) 64

65 2.2.5 비트연산자 피연산자의해당비트들에대한연산을수행 피연산자의비트수가같지않으면, 비트수가작은피연산자의 MSB 위치에 0이채워진후, 연산됨 표 2.16 비트 and 연산자 & 0 1 x z x x x 0 x x x 표 2.17 비트 or 연산자 0 1 x z x x x x 1 x x z 0 x x x z x 1 x x Ver1.0 (2008) 65

66 2.2.5 비트연산자 표 2.18 비트 xnor 연산자 ~^ 0 1 x z x x x x x x x x x z x x x x 표 2.19 비트 xor 연산자 ^ 0 1 x z x x x x x x x x x z x x x x 표 2.20 비트부정연산자 ~ x x z x // D = 4'b1001, E = 4'b1101, F = 4'b10x11 ~D // 결과값은 4'b0110 D & E // 결과값은 4'b1001 D E // 결과값은 4'b1101 D ^ E // 결과값은 4'b0100 D ~^ E // 결과값은 4'b1011 D & F // 결과값은 4'b10x11 Ver1.0 (2008) 66

67 2.2.6 축약 (reduction) 연산자 단항연산자 피연산자의단위비트들에적용되어단일비트의결과값을생성 reg[7:0] cnt; assign parity = ^cnt; assign parity = cnt[7]^cnt[6]^cnt[5]^cnt[4]^cnt[3]^cnt[2]^cnt[1]^cnt[0]; 표 2.21 축약 and 연산자 & 0 1 x z x x x 0 x x x z 0 x x x 축약 nand 연산자 ~& 0 1 x z x x x 1 x x x z 1 x x x Ver1.0 (2008) 67

68 2.2.6 축약연산자 표 2.22 축약 or 연산자 0 1 x z x x x x 1 x x z x 1 x x 축약 nor 연산자 ~ 0 1 x z x x x x 0 x x z x 0 x x 표 2.23 축약 xor 연산자 축약 xnor 연산자 ^ 0 1 x z ~^ 0 1 x z x x x x x x x x x x x x x x x x x x z x x x x z x x x x Ver1.0 (2008) 68

69 2.2.6 축약연산자 피연산자 연산자 연산결과 & ~& ~ ^ ~^ 설명 4'b 모든비트가 0 인경우 4'b 모든비트가 1 인경우 4'b 의개수가짝수인경우 4'b 의개수가홀수인경우 Ver1.0 (2008) 69

70 2.2.7 시프트연산자 논리시프트연산자 ( <<, >> ) << : 우측피연산자값만큼좌측으로시프트후, 비어있는비트에 0 을채움 >> : 우측피연산자값만큼우측으로시프트후, 비어있는비트에 0을채움 산술시프트연산자 ( >>>, <<< ) <<< : 우측피연산자값만큼좌측으로시프트후, 비어있는비트에 0을채움 >>> : 우측피연산자값만큼우측으로시프트후, 비어있는비트에좌측 피연산자의 MSB 를채움 우측피연산자 x 또는 z가포함된경우, 시프트연산의결과값은 x 항상 unsigned 수 Ver1.0 (2008) 70

71 2.2.7 시프트연산자 // A = 4'b1100 B = A >> 1 // 오른쪽으로 1비트시프트, 결과값은 B=4'b0110 C = A << 1 // 왼쪽으로 1비트시프트, 결과값은 B=4'b1000 D = A << 2 // 왼쪽으로 2비트시프트, 결과값은 B=4'b0000 논리시프트연산 module shift; reg [3:0] start, result; initial begin start = 1; result =(start << 2); // 결과값은 0100 end endmodule Ver1.0 (2008) 71

72 2.2.7 시프트연산자 산술시프트연산 module ashift; reg signed [3:0] start, t result; initial begin start = 4'b1000; result =(start >>> 2); // 결과값은 1110 end endmodule Ver1.0 (2008) 72

73 2.2.8 조건연산자 조건연산자 expression1 이참 (1, 즉 0, x 또는 z 가아닌값 ) 으로평가되면 expression2 의값이좌변의변수에할당 expression1 이거짓 (0) 으로평가되면 expression3 의값이좌변의 변수에결과값으로할당 expression1 이 x 또는 z 이면 ( 즉, 참또는거짓을판단할수없는 모호성이존재하는경우 ), expression2와 expression3을함께평가하여비트단위로비교된값이좌변의변수에할당 expression3이 real 형값이아니면결과값은비트단위로비교되어결정되며, real 형값인경우에는결과값은0이됨 conditional_expression ::= expression1? expression2 : expression3 Ver1.0 (2008) 73

74 2.2.8 조건연산자 표 2.24 조건에애매성이존재하는경우의조건연산자의결과값결정? : 0 1 x z 0 0 x x x 1 x 1 x x x x x x x z x x x x 조건연산자를이용한 3 상태버퍼 wire [15:0] busa = drive_ busa? data : 16'bz; Ver1.0 (2008) 74

75 2.2.9 결합및반복연산자 결합연산자 중괄호 { } 에의해묶인두개이상의표현이갖는비트들을결합 결합되는피연산자들은각각의크기를결정할수있어야결합이가능 unsized 상수는결합연산자로결합시킬수없음 {a, b[3:0], w, 3'b101} // 결합연산자의결과 {a, b[3], b[2], b[1], b[0], w, 1'b1, 1'b0, 1'b1} Ver1.0 (2008) 75

76 2.2.9 결합및반복연산자 결합연산자 대입문의좌측또는우측에사용가능 비트폭이일치하지않는변수의연산이나대입이허용됨 우변의비트폭이작은경우, 우변의 MSB에 0을붙여연산됨 좌변의비트폭이우변보다작을경우, MSB는누락되어저장 wire [15:0] addr_bus; assign addr_bus = {addr_hi, addr_lo}; // addr_hi, addr_lo 는 8 비트신호 wire [3:0] a, b, sum; wire carry; assign {carry, sum} = a + b; // 4비트데이터의덧셈은 5비트결과 // 좌변이 5 비트이므로, 우변의 a+b는 MSB에 0을붙인 5비트로연산됨 Ver1.0 (2008) 76

77 2.2.9 결합및반복연산자 반복연산자 {a{b}}{b}} 의형태로표현하여 b 를 a 회반복 반복횟수 a는 0, x, z가아닌상수이어야함 {4{w}} // {w, w, w, w} 와동일한표현. a[31:0] = {1'b1, {0{1'b0}} }; // 우변이 {1'b1} 가되므로잘못된표현임. a[31:0] = {1'b1, {1'bz{1'b0}} }; // 우변이 {1'b1} 가되므로잘못된표현임. a[31:0] = {1'b1, {1'bx{1'b0}} }; // 우변이 {1'b1} 가되므로잘못된표현임. result = {func(w), func(w), func(w), func(w)}; result = {4{func(w)}}; // 위의문장과동일함. {b, {3{a,{ b}}} // {b, a, b, a, b, a, b} 와동일함. Ver1.0 (2008) 77

78 Verilog HDL 을이용한디지털시스템설계및실습 3. 게이트수준모델링 Ver1.0 (2008) 78

79 게이트및스위치프리미티브 predefined primitives 정의나선언없이사용가능 단일출력을가짐 모듈내에서만사용가능 initial 과 always 구문내부에서는사용불가 표 3.1 Verilog 에서제공되는게이트및스위치프리미티브 n-input gates n-output gates three-state gates pull gates MOS switches bidirectional switches and buf bufif0 pulldown cmos rtran nand not bufif1 pullup nmos rtranif0 nor notif0 pmos rtranif1 or notif1 rcoms tran xnor rnmos tranif0 xor rpmos tranif1 Ver1.0 (2008) 79

80 3.1 게이트프리미티브 gate primitives 인스턴스구문 primitive_gate_name [#(n1,n2)][instance_name](output, input1,..); #(n1,n2) : 게이트프리미티브의지연. default 지연값은 0 n1 : 상승지연, n2 : 하강지연 min(n1, n2) : 출력이 x (unknown) 로변할때의지연 instance_name name : 생략가능 포트연결 : 순서에의한매핑만사용가능 ( 이름에의한포트매핑불가능 ) 출력포트가처음에오며, 입력신호들은임의의순서로나열 Ver1.0 (2008) 80

81 3.1 게이트프리미티브 and 게이트 and 0 1 x z x x x 0 x x x z 0 x x x or 게이트 or 0 1 x z x x x x 1 x x z x 1 x x nand 게이트 nand 0 1 x z x x x 1 x x x z 1 x x x nor 게이트 nor 0 1 x z x x x x 0 x x z x 0 x x Ver1.0 (2008) 81

82 3.1 게이트프리미티브 xor 게이트 xnor 게이트 xor 0 1 x z xnor 0 1 x z x x x x x x x x x z x x x x x x x x x x x x x z x x x x Ver1.0 (2008) 82

83 3.1 게이트프리미티브 and U1(out1, a, b); // 2 입력 and 게이트 nand (out2, a, b); // 인스턴스이름을생략한경우 or U3(out3, a, b, c); // 3 입력 or 게이트 nor #(2) U4(out4, a, b); // 2 입력 nor 게이트 xor #(3, 4) U5(out5, c, b, a); // 3 입력 xor 게이트 xnor U6(out6, a, b); // 2 입력 xnor 게이트 // multiple instantiations Ver1.0 (2008) 83

84 3.1 게이트프리미티브 module full_adder_g(a, b, cin, sum, cout); input a, b, cin; output sum, cout; wire s1, c1, c2; xor (s1, a, b); and (c1, a, b); and G3 (c2, s1, cin); xor G4 (sum, s1, cin); xor G5 (cout, c1, c2); endmodule d a b s1 sum c2 cin cout c1 Ver1.0 (2008) 84

85 3.2 buf 와 not 게이트프리미티브 buf 게이트 not 게이트 input output input output buf input output x x z x not input output x x z x buf b1(out1, out2, in); not #5 inv(out, in); Ver1.0 (2008) 85

86 3.3 3 상태버퍼프리미티브 3 상태버퍼프리미티브 포트연결 : 순서에의한매핑만사용가능 출력포트, 데이터입력포트, 제어입력포트의순서로매핑 3 개의지연값지정 : #(n1, n2, n3) n1 : 상승지연,n2: 하강지연,n3:z 로변할때의지연 min(n1, n2, n3) : 출력이 x 로변할때의지연 2개의지연값지정 : #(n1, n2) n1 : 상승지연, n2 : 하강지연 min(n1, n2) : 출력이 x 또는 z 로변할때의지연 bufif0 bf0(out0, in, control); bufif1 #(10,12,11) bf1(out1, in, control); Ver1.0 (2008) 86

87 3.3 3 상태버퍼프리미티브 bufif1 게이트 bufif0 게이트 data out data out bufif1 D A T A control CONTROL 0 1 x z 0 z 0 L L 1 z 1 H H x z x x x z z x x x bufif0 D A T A control CONTROL 0 1 x z 0 0 z L L 1 1 z H H x x z x x z x z x x L:0 또는 z 가될수있는 unknown H:1 또는 z 가될수있는 unknown Ver1.0 (2008) 87

88 3.3 3 상태버퍼프리미티브 notif1 게이트 notif0 게이트 data out data out control control CONTROL CONTROL notif1 notif0 0 1 x z 0 1 x z 0 z 1 H H 0 1 z H H D D A 1 z 0 L L A 1 0 z L L T x z x x x T x x z x x A A z z x x x z x z x x Ver1.0 (2008) 88

89 3.4 논리게이트인스턴스의배열 게이트인스턴스의배열 인스턴스이름뒤에배열의범위를지정하여반복회수를표현 nand #2 t_nand[0:3](... ), t_nand[4:7](... ); // syntax error nand #2 t_nand[0:7](... ); nand #2 x_nand[0:3](... ), y_nand[4:7](... ); Ver1.0 (2008) 89

90 3.4 논리게이트인스턴스의배열 module driver(in, out, en); input [3:0] in; input en; output t [3:0] out; bufif0 ar[3:0](out, in, en); // 3 상태버퍼의배열 endmodule 코드 3.2 module driver_eq(in, out, en); // 코드 3.2와등가 input [3:0] in; input en; output [3:0] out; bufif0 ar3(out[3], in[3], en); // 3상태버퍼의개별적인인스턴스 bufif0 ar2(out[2], in[2], en); bufif0 ar1(out[1], in[1], en); bufif0 ar0(out[0], in[0], en); endmodule 코드 Ver1.0 (2008) 90

91 3.5 게이트지연과 net 지연 게이트지연 게이트의입력에서부터출력까지의신호전달지연 (propagation delay) 상승지연, 하강지연, 턴-오프 (turn-off) 지연 defualt 값은 0 net 지연 net를구동하는driver의값이변하는시점부터net의값이갱신되는 시점까지소요되는시간 상승지연, 하강지연, 턴-오프 (turn-off) 지연 defualt 값은 0 관성지연 (inertial delay) 지정된지연값보다입력신호의변화폭이작은경우에는입력신호가 출력에영향을미치지않음 Verilog HDL의 default 지연 Ver1.0 (2008) 91

92 3.5 게이트지연과 net 지연 From value: To value: 2개의지연값 (d1, d2) 이사용된경우 3개의지연값 (d1, d2, d3) 이사용된경우 0 1 d1 d1 0 x min(d1, d2) min(d1, d2, d3) 0 z min(d1, d2) d3 1 0 d2 d2 1 x min(d1, d2) min(d1, d2, d3) 1 z min(d1, d2) d3 x 0 d2 d2 x 1 d1 d1 x z min(d1, d2) d3 z 0 d2 d2 z 1 d1 d1 z x min(d1, d2) min(d1, d2, d3) Ver1.0 (2008) 92

93 3.5 게이트지연과 net 지연 and #(10) a1(out, in1, in2); // only one delay and #(10,12) a2(out, in1, in2); // rise and fall delays bufif0 #(10,12,11) b3(out, in, ctrl); // rise, fall, turn-off delays 3 상태출력을갖는래치 module tri_latch(qout, qbout, clock, data, enable); output qout, qbout; input clock, data, enable; tri qout, qbout; not #5 n1(ndata, data); nand #(3,5) n2(wa, data, clock), n3(wb, ndata, clock); nand #(12,15) n4(q, qb, wa), n5(qb, q, wb); bufif1 #(3,7,13) q_drive(qout, q, enable), qb_drive(qbout, qb, enable); endmodule 코드 Ver1.0 (2008) 93

94 3.5 게이트지연과 net 지연 data ndata wb qb qbout clock wa q qout enable 그림 상태출력을갖는래치 Ver1.0 (2008) 94

95 3.5 게이트지연과 net 지연 module inertial_delay_gate(); reg a, b; and #30(out, a, b); initial begin a = 1'b0; b = 1'b0; #50 a = 1'b1; b = 1'b1; #50 a = 1'b0; b = 1'b0; #50 a = 1'b1; b = 1'b1; #20 b = 1'b0; #50; end endmodule 게이트지연에서의관성지연 코드 3.5 Ver1.0 (2008) 95

96 Verilog HDL 을이용한디지털시스템설계및실습 4. 할당문 Ver1.0 (2008) 96

97 할당문 할당문 연속할당문 : net 형객체에값을할당 assign 문 continuous_assign ::= assign [driving_strength] [delay] net_assignments; 절차형할당문 : variable 형객체에값을할당 always 블록, initial 블록, task, function 내부의할당문 blocking 할당문 : 할당기호 = 을사용 nonblocking 할당문 : 할당기호 <= 을사용 절차형연속할당문 (Procedural Continuous Assignment; PCA) assign - deassign 문, force - release 문 Ver1.0 (2008) 97

98 할당문 표 할당문좌변의형태 할당문형태 연속할당 절차형할당 Net (vector or scalar) 좌변 (Left-hand Side; LHS) Constant bit select of a vector net Constant part select of a vector net Constant indexed part select of a vector net Concatenation of any of the above four LHS Variables (vector or scalar) Bit-select of a vector reg, integer, or time variable Constant part select of a vector reg, integer, or time variable Memory word Indexed part select of vector reg, integer, or time variable Concatenation of regs; bit or part selects of regs Ver1.0 (2008) 98

99 4.1 연속할당문 연속할당문 assign 문을이용하여 net 형객체에값을할당 우변의값에변화 (event) 가발생했을때좌변의객체에값의할당이 일어남 단순한논리표현을이용한조합논리회로모델링에이용 함축적 (implicit) 연속할당문 net 선언문에연속할당문을포함시킨경우 wire mynet = enable & data; wire mynet; 함축적연속할당문과등가 assign mynet = enable & data; Ver1.0 (2008) 99

100 4.1 연속할당문 assign na = ~(in1 & in2); // 2 input NAND assign out = (sel==1)? d1 : d0; // 2-to-1 MUX assign carry = (cnt10==4 h9); assign sum = a + b; // 덧셈회로 연속할당문을이용한 4 비트가산기 module adder (sum_out, carry_out, carry_in, ina, inb); output [3:0] sum_out; output carry_out; input [3:0] ina, inb; input carry_in; assign {carry_out, sum_out} = ina + inb + carry_in; endmodule 코드 4.1 Ver1.0 (2008) 100

101 4.1 연속할당문 module select_bus (busout, bus0, bus1, bus2, bus3, enable, s); parameter n = 16; parameter Zee = 16'bz; output [1:n] busout; input [1:n] bus0, bus1, bus2, bus3; input enable; p tri [1:n] data; // net declaration input [1:2] s; 연속할당문을이용한 16비트출력버스 // 연속할당을갖는 net 선언 ( 함축적연속할당문 ) tri [1:n] busout = enable? data : Zee; // 4 개의 assign 문을이용한표현 assign data =(s == 0)? bus0 : Zee; assign data =(s == 1)? bus1 : Zee; assign data =(s == 2)? bus2 : Zee; assign data =(s == 3)? bus3 : Zee; /* 하나의 assign 문으로 4개의연속할당을표현 ( 위의 4개의 assign 문과등가임 ) assign data =(s == 0)? bus0 : Zee, data =(s == 1)? bus1 : Zee, data =(s == 2)? bus2 : Zee, data =(s == 3)? bus3 : Zee; */ endmodule 코드 4.2 Ver1.0 (2008) 101

102 4.1.1 할당지연과 net 지연 연속할당문의지연값지정 assign 뒤에지연연산자 (#) 를사용하여지정 우변피연산자값의변화에서부터그값이좌변에할당되기까지의 시간간격을지정 assign #10 wirea = a & b; wire #10 wirea = a & b; // 함축적연속할당문의지연 net 지연 net 선언문에서지연값을지정 지정된 net 지연이경과한후에할당이이루어짐 해당 net를구동하는모든구동자 ( 게이트프리미티브, 연속할당문 ) wire ) 등 #10 ) 에wireA; 영향을미침 Ver1.0 (2008) 102

103 4.1.1 할당지연과 net 지연 관성지연 (inertial delay) Verilog HDL 의 default 지연 지정된지연값보다입력신호의변화폭이작은경우, 입력신호의 변화가출력에영향을미치지않음 관성지연은게이트수준모델링에도동일하게적용 관성지연의적용과정 1 우변수식의값이평가된다. 2 평가된우변의값이좌변에할당예정된값과다르면, 현재예정된할당 event 가 취소된다. 3 새로운우변의값이좌변의현재값과동일하면할당을위한 event 가예정되지 않는다. 4 새로운우변의값이좌변의현재값과다르면, 지연이계산되고주어진지연후에 새로운할당 event 가일어나도록예정된다. Ver1.0 (2008) 103

104 4.1.1 할당지연과 net 지연 module inertial_delay(); reg a, b; assign #30 wirea = a & b; initial iti begin a = 1'b0; b = 1'b0; #50 a = 1'b1; b = 1'b1; #50 a = 1'b0; b = 1'b0; #50 a = 1'b1; b = 1'b1; #20 b = 1'b0; #50; end endmodule d 코드 4.3 Ver1.0 (2008) 104

105 4.2 절차형할당문 절차형할당문 reg, integer, real, time, realtime 등 variable 에값을갱신 지연을갖지않으며, 다음절차형할당문에의해값이갱신될때까지변수에 할당된값을유지 always, initial, task, function 등의프로시저 (procedure) 내부에서사용 문장의실행에의해좌변 variable 에값이할당되는소프트웨어적인특성 우변수식의 event 발생과는무관 할당문들의순서가시뮬레이션결과에영향을미칠수있음 함축적변수할당문 variable 선언문에서 variable 에대한초기값을설정 배열에대한함축적변수할당은허용되지않음 Ver1.0 (2008) 105

106 4.2 절차형할당문 module proc_assignment(a, b, c, out); input a, b; output out; reg out, c; c) begin c = a & b; // blocking assignment out <= c; // nonblocking assignment end endmodule 코드 4.4 reg[3:0] areg = 4'h4; reg[3:0] areg; 함축적변수할당문과등가 initial areg = 4'h4; reg [3:0] array [3:0] = 0; //illegal ( 배열에대한함축적변수할당문 ) Ver1.0 (2008) 106

107 4.3 절차형연속할당문 (PCA) 절차형연속할당문 (Procedural Continuous Assignment; PCA) 절차형할당문의예외적인구문 variable 또는 net에대해연속적구동을허용하는절차형할당문 assign - deassign 문 assign PCA 문 : reg 형 variable 에연속할당문인 assign 을사용하여 절차형할당을덮어쓰기 (override) 하는예외적인구문 deassign PCA 문 : variable 에대한 assign PCA 문의영향을제거 force-release 문 assign - deassign 문과기능이동일하나, force는 variable뿐만아니라 net에도사용될수있음 variable에대한force 문 : release 문이실행되기전까지절차형할당또는 PCA 문을덮어쓰기한다. net에대한force 문 : release 문이실행되기전까지 net, 게이트및모듈출력, 연속할당문등의모든 driver를덮어쓰기한다. Ver1.0 (2008) 107

108 4.3 절차형연속할당문 (PCA) edge-triggered gg D 플립플롭의비동기 clear/preset 동작모델링 module dff(q, d, clear, preset, clock); output q; input d, clear, preset, clock; reg q; or preset) if(!clear) assign q = 0; else if(!preset) assign q = 1; else deassign q; clock) q = d; endmodule 코드 4.5 Ver1.0 (2008) 108

109 4.3 절차형연속할당문 (PCA) module force_release; reg a, b, c, d; wire e; and and1(e, a, b, c); initial begin $monitor("%d d=%b,e=%b", $time, d, e); assign d = a & b & c; a = 1; b = 0; c = 1; #10; force d =(a b c); force e =(a b c); #10 $stop; release d; release e; #10 $finish; 0 d=0,e=0 end 10 d=1,e=1 endmodule 20 d=0,e=0 0 코드 Ver1.0 (2008) 109

디지털시스템설계및실습 1. Verilog HDL 문법 한국기술교육대학교전기전자통신공학부 Ver1.0 (2008)1

디지털시스템설계및실습 1. Verilog HDL 문법 한국기술교육대학교전기전자통신공학부 Ver1.0 (2008)1 디지털시스템설계및실습 1. Verilog HDL 문법 Ver1.0 (2008)1 Verilog HDL 의역사 q Verilog HDL v 1983년 Gateway Design Automation사에서하드웨어기술언어인 HiLo와 C 언어의특징을기반으로개발 v 1991년 Cadence Design Systems가 Open Verilog International

More information

Microsoft PowerPoint - DSD01_verilog1a.pptx

Microsoft PowerPoint - DSD01_verilog1a.pptx 한국기술교육대학교 장영조 한국기술교육대학교전기전자통신공학부 2 1. Verilog HDL 개요 2. Verilog 첫걸음 3. Verilog 어휘규칙 4. 모듈 5. 데이터형 6. 연산자 7. 인스턴스 8. 시스템태스크와함수 9. 컴파일러지시어 한국기술교육대학교전기전자통신공학부 3 Verilog HDL 1983 년 Gateway Design Automation

More information

Microsoft PowerPoint - verilog문법new.ppt

Microsoft PowerPoint - verilog문법new.ppt Verilog HDL Syntax HDL 이란? HDL(Hardware Description Language) VLSI 설계가복잡도증가및 time-to-market 감소 GLM 의 schematic 설계불가능 HDL 언어를이용한시스템및회로수준구현보편화 하드웨어기술언어논리회로의프로그래밍언어에의한표현네트리스트및프로그래밍언어적표현 다양한하드웨어설계방법지원 Structural

More information

Microsoft PowerPoint - hw4.ppt [호환 모드]

Microsoft PowerPoint - hw4.ppt [호환 모드] 4.1 initial 과 always Chapter 4 Verilog의특징 보통의 programming언어와같은 procedural statement을제공 추상적인 behavioral model 기술에사용 순차적으로수행하는보통의 programming 언어와는다르게병렬적으로수행하는언어임 module Behavioral Model 논리설계 병렬수행 module

More information

OCW_C언어 기초

OCW_C언어 기초 초보프로그래머를위한 C 언어기초 4 장 : 연산자 2012 년 이은주 학습목표 수식의개념과연산자및피연산자에대한학습 C 의알아보기 연산자의우선순위와결합방향에대하여알아보기 2 목차 연산자의기본개념 수식 연산자와피연산자 산술연산자 / 증감연산자 관계연산자 / 논리연산자 비트연산자 / 대입연산자연산자의우선순위와결합방향 조건연산자 / 형변환연산자 연산자의우선순위 연산자의결합방향

More information

Microsoft PowerPoint - DSD01_verilog1b.pptx

Microsoft PowerPoint - DSD01_verilog1b.pptx 한국기술교육대학교 장영조 한국기술교육대학교전기전자통신공학부 2 1. Velilog HDL 개요 2. Verilog 첫걸음 3. Velilog 어휘규칙 4. 모듈 5. 데이터형 6. 연산자 7. 인스턴스 8. 시스템태스크와함수 9. 컴파일러지시어 한국기술교육대학교전기전자통신공학부 3 설계의기본단위 모듈구성 module module_name (port_list);

More information

MAX+plus II Getting Started - 무작정따라하기

MAX+plus II Getting Started - 무작정따라하기 무작정 따라하기 2001 10 4 / Version 20-2 0 MAX+plus II Digital, Schematic Capture MAX+plus II, IC, CPLD FPGA (Logic) ALTERA PLD FLEX10K Series EPF10K10QC208-4 MAX+plus II Project, Schematic, Design Compilation,

More information

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt 변수와상수 1 변수란무엇인가? 변수 : 정보 (data) 를저장하는컴퓨터내의특정위치 ( 임시저장공간 ) 메모리, register 메모리주소 101 번지 102 번지 변수의크기에따라 주로 byte 단위 메모리 2 기본적인변수형및변수의크기 변수의크기 해당컴퓨터에서는항상일정 컴퓨터마다다를수있음 short

More information

Microsoft PowerPoint - chap04-연산자.pptx

Microsoft PowerPoint - chap04-연산자.pptx int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); } 1 학습목표 수식의 개념과 연산자, 피연산자에 대해서 알아본다. C의 를 알아본다. 연산자의 우선 순위와 결합 방향에

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Verilog: Finite State Machines CSED311 Lab03 Joonsung Kim, joonsung90@postech.ac.kr Finite State Machines Digital system design 시간에배운것과같습니다. Moore / Mealy machines Verilog 를이용해서어떻게구현할까? 2 Finite State

More information

Microsoft PowerPoint - DSD02_verilog2b.pptx

Microsoft PowerPoint - DSD02_verilog2b.pptx 한국기술교육대학교 장영조 한국기술교육대학교전기전자통신공학부 2 1. 구조적모델링 1. 모듈인스턴스와포트사양 2. 프리미티브게이트 3. 게이트지연시간 4. 파라미터 5. 인스턴스배열 6. generate 블록 2. 데이터플로우모델링 1. 연속할당문 2. 할당지연 3. 동작적모델링 1. 절차형블록 2. 절차형할당문 3. if~else문 4. case 문 5. 반복문

More information

wire [n-1:0] a, b, c, d, e, f, g, h; wire [n-1:0] x; // internal wires wire [n-1:0] tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; mux_2to1 mux001 (.x(tmp0),.a(a

wire [n-1:0] a, b, c, d, e, f, g, h; wire [n-1:0] x; // internal wires wire [n-1:0] tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; mux_2to1 mux001 (.x(tmp0),.a(a [2010 년디지털시스템설계및실험중간고사 1 답안지 ] 출제 : 채수익 Verilog 문법채점기준 ( 따로문제의채점기준에명시되어있지않아도적용되어있음 ) (a) output이 always 문에서사용된경우, reg로선언하지않은경우 (-1 pts) (b) reg, wire를혼동하여사용한경우 (-1 pts) (c) always @( ) 에서모든 input을 sensitivity

More information

Microsoft PowerPoint - hw8.ppt [호환 모드]

Microsoft PowerPoint - hw8.ppt [호환 모드] 8.1 데이터경로와제어장치 Chapter 8 데이터경로와제어장치 많은순차회로의설계는다음의두부분으로구성 datapath: data의이동및연산을위한장치 control unit에상태신호제공 control ol unit: datapath th 에서적절한순서로 data 이동및연산을수행할수있도록제어신호제공. 먼저, datapath를설계 다음에, control unit

More information

Microsoft PowerPoint - DSD03_verilog3a.pptx

Microsoft PowerPoint - DSD03_verilog3a.pptx 한국기술교육대학교 장영조 한국기술교육대학교전기전자통신공학부 2 1. 조합회로설계 2. 순차회로설계 3. FSM 회로설계 4. ASM 을사용한설계 한국기술교육대학교전기전자통신공학부 3 조합논리회로의형태와설계에사용되는 Verilog 구문 조합논리회로의형태 조합논리회로설계에사용되는 Verilog 구문 논리합성이지원되지않는 Verilog 구문 논리게이트 Multiplexer

More information

ºÎ·ÏB

ºÎ·ÏB B B.1 B.2 B.3 B.4 B.5 B.1 2 (Boolean algebra). 1854 An Investigation of the Laws of Thought on Which to Found the Mathematical Theories of Logic and Probabilities George Boole. 1938 MIT Claude Sannon [SHAN38].

More information

Microsoft PowerPoint - DSD03_verilog3b.pptx

Microsoft PowerPoint - DSD03_verilog3b.pptx 한국기술교육대학교 장영조 한국기술교육대학교전기전자통신공학부 2 . 조합회로설계 2. 순차회로설계 3. FSM 회로설계 4. ASM 을사용한설계 한국기술교육대학교전기전자통신공학부 3 input clk 유한상태머신 (Finite State Machine; FSM) 지정된수의상태로상태들간의천이에의해출력을생성하는회로 디지털시스템의제어회로구성에사용 Moore 머신 :

More information

Microsoft PowerPoint - Verilog_Summary.ppt

Microsoft PowerPoint - Verilog_Summary.ppt Verilog HDL Summury by 강석태 2006 년 3 월 1 Module module < 모듈이름 >(< 포트리스트 >) < 모듈내용 > endmodule C 언어의함수 (Function) 와같은개념. 대소문자구분. 예약어는소문자로만쓴다. 이름은영문자, 숫자, 언더바 (_) 만허용한다. 문장의끝은항상세미콜론 (;) 으로끝난다. end~ 로시작하는예약어에는

More information

歯Chap1-Chap2.PDF

歯Chap1-Chap2.PDF ASIC Chip Chip Chip Proto-Type Chip ASIC Design Flow(Front-End) ASIC VHDL Coding VHDL Simulation Schematic Entry Synthesis Test Vector Gen Test Vector Gen Pre-Simulation Pre-Simulation Timing Verify Timing

More information

디지털공학 5판 7-8장

디지털공학 5판 7-8장 Flip-Flops c h a p t e r 07 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 292 flip flop Q Q Q 1 Q 0 set ON preset Q 0 Q 1 resetoff clear Q Q 1 2 SET RESET SET RESET 7 1 crossednand SET RESET SET RESET

More information

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 비트연산자 1 1 비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 진수법! 2, 10, 16, 8! 2 : 0~1 ( )! 10 : 0~9 ( )! 16 : 0~9, 9 a, b,

More information

Microsoft Word - 제6장 Beyond Simple Logic Gate.doc

Microsoft Word - 제6장 Beyond Simple Logic Gate.doc 제 6 장 Beyond Simple Logic Gate 실험의목표 - MUX, DEMUX의동작을이해하도록한다. - encoder 와 decoder 의원리를익히고 MUX, DEMUX 와비교를해본다. - MUX 를이용하여조합회로를설계해본다. - tri-state gate 와 open-collector gate 의특성에대하여알아본다. 잘못된사용법에대하여어떤결과가발생하는지확인해본다.

More information

게이트및스위치프리미티브 q predefined primitives v 정의나선언없이사용가능 v 단일출력을가짐 v 모듈내에서만사용가능 Ø initial과 always 구문내부에서는사용불가 Verilog 에서제공되는게이트및스위치프리미티브 n-input gates n-out

게이트및스위치프리미티브 q predefined primitives v 정의나선언없이사용가능 v 단일출력을가짐 v 모듈내에서만사용가능 Ø initial과 always 구문내부에서는사용불가 Verilog 에서제공되는게이트및스위치프리미티브 n-input gates n-out 디지털시스템설계및실습 3. 게이트수준모델링 1 게이트및스위치프리미티브 q predefined primitives v 정의나선언없이사용가능 v 단일출력을가짐 v 모듈내에서만사용가능 Ø initial과 always 구문내부에서는사용불가 Verilog 에서제공되는게이트및스위치프리미티브 n-input gates n-output gates three-state gates

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

Microsoft PowerPoint - DSD02_verilog2a.pptx

Microsoft PowerPoint - DSD02_verilog2a.pptx 한국기술교육대학교 장영조 한국기술교육대학교전기전자통신공학부 2 1. 구조적모델링 1. 모듈인스턴스와포트사양 2. 프리미티브게이트 3. 게이트지연시간 4. 파라미터 5. 인스턴스배열 6. generate 블록 2. 데이터플로우모델링 1. 연속할당문 2. 할당지연 3. 동작적모델링 1. 절차형블록 2. 절차형할당문 3. if~else문 4. case 문 5. 반복문

More information

Microsoft PowerPoint - C프로그래밍-chap03.ppt [호환 모드]

Microsoft PowerPoint - C프로그래밍-chap03.ppt [호환 모드] Chapter 03 변수와자료형 2009 한국항공대학교항공우주기계공학부 (http://mercury.kau.ac.kr/sjkwon) 1 변수와자료유형 변수 프로그램에서자료값을임시로기억할수있는저장공간을변수 (variables) 변수 (Variables) 는컴퓨터의메모리인 RAM(Random Access Memory) 에저장 물건을담는박스라고생각한다면박스의크기에따라담을물건이제한됨

More information

슬라이드 1

슬라이드 1 보안회로설계 순차회로 Dong Kyue Kim Hanyang University dqkim@hanyang.ac.kr 조합과순차 조합회로 (combinational circuit) Memory가없다. 입력한값에따른출력 출력 = f ( 입력 ) 순차회로 (sequential circuit) Memory가있다. Memory에는회로의현상태가저장 출력은입력과현상태에의해결정

More information

프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음

프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음 프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음 CHAPTER 9 둘중하나선택하기 관계연산자 두개의피연산자를비교하는연산자 결과값은참 (1) 아니면거짓 (0) x == y x 와 y 의값이같은지비교한다. 관계연산자 연산자 의미 x == y x와 y가같은가? x!= y

More information

슬라이드 1

슬라이드 1 3 장. 선행자료 어휘원소, 연산자와 C 시스템 박종혁교수 UCS Lab Tel: 970-6702 Email: jhpark1@seoultech.ac.kr SeoulTech 2019-1 st 프로그래밍입문 (1) 2 목차 1.1 문자와어휘원소 1.2 구문법칙 1.3 주석 1.4 키워드 (Keyword) 1.5 식별자 (Identifier) 1.6 상수 (Integer,

More information

슬라이드 1

슬라이드 1 Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 실습 1 배효철 th1g@nate.com 1 목차 조건문 반복문 System.out 구구단 모양만들기 Up & Down 2 조건문 조건문의종류 If, switch If 문 조건식결과따라중괄호 { 블록을실행할지여부결정할때사용 조건식 true 또는 false값을산출할수있는연산식 boolean 변수 조건식이 true이면블록실행하고 false 이면블록실행하지않음 3

More information

歯03-ICFamily.PDF

歯03-ICFamily.PDF Integrated Circuits SSI(Small Scale IC) 10 / ( ) MSI(Medium Scale IC) / (, ) LSI(Large Scale IC) / (LU) VLSI(Very Large Scale IC) - / (CPU, Memory) ULSI(Ultra Large Scale IC) - / ( ) GSI(Giant Large Scale

More information

Microsoft PowerPoint - chap-05.pptx

Microsoft PowerPoint - chap-05.pptx 쉽게풀어쓴 C 언어 Express 제 5 장수식과연산자 컴퓨터프로그래밍기초 이번장에서학습할내용 * 수식과연산자란? * 대입연산 * 산술연산 * 논리연산 * 관계연산 * 우선순위와결합법칙 이번장에서는수식과연산자를살벼봅니다. 컴퓨터프로그래밍기초 2 수식 수식 (expression) x + y x*x + 5*x + 6 (principal * interest_rate

More information

T100MD+

T100MD+ User s Manual 100% ) ( x b a a + 1 RX+ TX+ DTR GND TX+ RX+ DTR GND RX+ TX+ DTR GND DSR RX+ TX+ DTR GND DSR [ DCE TYPE ] [ DCE TYPE ] RS232 Format Baud 1 T100MD+

More information

KNK_C03_Expr_kor

KNK_C03_Expr_kor Expressions adopted from KNK C Programming : A Modern Approach Operators 연산자 C 는표현식을많이사용함 표현식은변수와상수와연산자로구성됨 C 에는연산자의종류가다양함 1. arithmetic operators ( 수식연산자 ) 2. relational operators ( 관계연산자 ) 3. logical

More information

Microsoft PowerPoint - [2009] 02.pptx

Microsoft PowerPoint - [2009] 02.pptx 원시데이터유형과연산 원시데이터유형과연산 원시데이터유형과연산 숫자데이터유형 - 숫자데이터유형 원시데이터유형과연산 표준입출력함수 - printf 문 가장기본적인출력함수. (stdio.h) 문법 ) printf( Test printf. a = %d \n, a); printf( %d, %f, %c \n, a, b, c); #include #include

More information

8장 조합논리 회로의 응용

8장 조합논리 회로의 응용 8 장연산논리회로 가산기 반가산기와전가산기 반가산기 (Half Adder, HA) 8. 기본가 / 감산기 비트의 개 진수를더하는논리회로. 개의입력과출력으로구성. 개입력은피연산수 와연산수 y 이고, 출력은두수를합한결과인합 S(sum) 과올림수 C(carry) 를발생하는회로. : 피연산수 : 연산수 : 합 y C S y S C 올림수 올림수 전가산기 : 연산수

More information

Microsoft PowerPoint - KNK_C03_Expr_kor

Microsoft PowerPoint - KNK_C03_Expr_kor Expressions adopted from KNK C Programming : A Modern Approach Operators 연산자 C 는표현식을많이사용함 표현식은변수와상수와연산자로구성됨 C 에는연산자의종류가다양함 1. arithmetic operators ( 수식연산자 ) 2. relational operators ( 관계연산자 ) 3. logical

More information

Microsoft Word - logic2005.doc

Microsoft Word - logic2005.doc 제 7 장 Flip-Flops and Registers 실험의목표 - S-R Latch 의동작을이해하도록한다. - Latch 와 Flip-flop 의차이를이해한다. - D-FF 과 JK-FF 의동작원리를이해한다. - Shift-register MSI 의동작을익히도록한다. - Timing 시뮬레이션방법에대하여습득한다. 실험도움자료 1. Universal Shift

More information

Microsoft PowerPoint 자바-기본문법(Ch2).pptx

Microsoft PowerPoint 자바-기본문법(Ch2).pptx 자바기본문법 1. 기본사항 2. 자료형 3. 변수와상수 4. 연산자 1 주석 (Comments) 이해를돕기위한설명문 종류 // /* */ /** */ 활용예 javadoc HelloApplication.java 2 주석 (Comments) /* File name: HelloApplication.java Created by: Jung Created on: March

More information

<4D F736F F F696E74202D C6F672D48444CC0BB20C0CCBFEBC7D120B5F0C1F6C5D0BDC3BDBAC5DBBCB3B0E82E707074>

<4D F736F F F696E74202D C6F672D48444CC0BB20C0CCBFEBC7D120B5F0C1F6C5D0BDC3BDBAC5DBBCB3B0E82E707074> Verilog-HDL 에의한 참고문헌 Verilog HDL : A Guide to Digital Design and Synthesis Author : Samir Palnikar Publisher : PTR-PH HDL Chip Design Author : Douglas J. Smith Publisher : Doone Publications Verilog Center

More information

Microsoft Word - logic2005.doc

Microsoft Word - logic2005.doc 제 8 장 Counters 실험의목표 - Catalog counter 의동작원리에대하여익힌다. - 임의의 counter를통하여 FSM 구현방법을익힌다. - 7-segment display 의동작원리를이해한다. 실험도움자료 1. 7-segment display 7-segment는디지털회로에서숫자를표시하기위하여가장많이사용하는소자이다. 이름에서알수있듯이 7개의 LED(

More information

슬라이드 1

슬라이드 1 보안회로설계 모델심설치 & Verilog testbench 기초문법 Dong Kyue Kim Hanyang University dqkim@hanyang.ac.kr 모델심설치 ModelSim ModelSim Made by Mentor HDL simulator VHDL, Verilog, System Verilog and optional SystemC HDL 에의해합성될회로의동작과정과결과예상

More information

[2010 년디지털시스템설계및실험중간고사 2 답안지 ] 출제 : 채수익 1. (a) (10 pts) Robertson diagram Quotient 와 remainder 의 correction 을뒤로미루는것이 non-restoring division 이다. 즉, q =

[2010 년디지털시스템설계및실험중간고사 2 답안지 ] 출제 : 채수익 1. (a) (10 pts) Robertson diagram Quotient 와 remainder 의 correction 을뒤로미루는것이 non-restoring division 이다. 즉, q = [2010 년디지털시스템설계및실험중간고사 2 답안지 ] 출제 : 채수익 1. (a) (10 pts) Robertson diagram Quotient 와 remainder 의 correction 을뒤로미루는것이 non-restoring division 이다. 즉, q = 1, 2r 0 1, 2r

More information

수없기때문에간단한부분으로나눠서구현하고, 이를다시합침으로써전체를구현하게 된다. 실험에서는이미구현된 4-Bit ALU인 74LS181 Chip을사용한다. 이 Chip은 4-bit의 Data input A, B와 Selection input 4 bit, Carry In 1

수없기때문에간단한부분으로나눠서구현하고, 이를다시합침으로써전체를구현하게 된다. 실험에서는이미구현된 4-Bit ALU인 74LS181 Chip을사용한다. 이 Chip은 4-bit의 Data input A, B와 Selection input 4 bit, Carry In 1 Experiment 6. Use of Arithmetic Logic Unit and Flip-Flops Abstract 본실험에서는현대 CPU의가장근간이되는 Unit인산술및논리연산기 (Arithmetic Logic Unit, ALU) 와순차회로 (Sequential Circuit) 을이루는대표적인기억소자인플립플롭 (Flip-flop) 의기능을익히며, 간단한연산회로와순차회로를구현해본다.

More information

歯02-BooleanFunction.PDF

歯02-BooleanFunction.PDF 2Boolean Algebra and Logic Gates 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 IC Chapter 2 Boolean Algebra & Logic Gates 1 Boolean Algebra 1854 George Boole Chapter 2 Boolean Algebra & Logic Gates 2 Duality Principle

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

슬라이드 1

슬라이드 1 2 장. 어휘원소, 연산자와 C 시스템 박종혁교수 UCS Lab Tel: 970-6702 Email: jhpark1@seoultech.ac.kr SeoulTech 2018-1 st 프로그래밍입문 (1) 2 목차 2.1 문자와어휘원소 2.2 구문법칙 2.3 주석 2.4 키워드 (Keyword) 2.5 식별자 (Identifier) 2.6 상수 (Integer,

More information

Microsoft PowerPoint - chap03-변수와데이터형.pptx

Microsoft PowerPoint - chap03-변수와데이터형.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num %d\n", num); return 0; } 1 학습목표 의 개념에 대해 알아본다.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

Microsoft PowerPoint - Chapter_02.pptx

Microsoft PowerPoint - Chapter_02.pptx 프로그래밍 1 1 Chapter 2. Types, Operators, and Expressions March, 2016 Dept. of software Dankook University http://embedded.dankook.ac.kr/~baeksj 이장의강의목표 2 변수의이해 C언어의표준키워드연산자소개키보드입력 변수의이해 (1/9) 3 덧셈예제 3 +

More information

Microsoft PowerPoint - VHDL01_chapter1.ppt [호환 모드]

Microsoft PowerPoint - VHDL01_chapter1.ppt [호환 모드] VHDL 프로그래밍 1. 문법기초 - 간단한조합회로및문법 학습목표 VHDL 기술과소프트웨어와차이파악 Signal assignment 의의미파악 Architecture body 의개념파악 Entity declaration 의개념파악 Process 문의사용법 Variable 과 signal 의차이파악 Library, Use, Package 의사용법 2/53 간단한논리회로예제

More information

API 매뉴얼

API 매뉴얼 PCI-DIO12 API Programming (Rev 1.0) Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned

More information

강의 개요

강의 개요 DDL TABLE 을만들자 웹데이터베이스 TABLE 자료가저장되는공간 문자자료의경우 DB 생성시지정한 Character Set 대로저장 Table 생성시 Table 의구조를결정짓는열속성지정 열 (Clumn, Attribute) 은이름과자료형을갖는다. 자료형 : http://dev.mysql.cm/dc/refman/5.1/en/data-types.html TABLE

More information

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F >

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202839C1D6C2F7207E203135C1D6C2F > 10주차 문자 LCD 의인터페이스회로및구동함수 Next-Generation Networks Lab. 5. 16x2 CLCD 모듈 (HY-1602H-803) 그림 11-18 19 핀설명표 11-11 번호 분류 핀이름 레벨 (V) 기능 1 V SS or GND 0 GND 전원 2 V Power DD or V CC +5 CLCD 구동전원 3 V 0 - CLCD 명암조절

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Lecture 02 프로그램구조및문법 Kwang-Man Ko kkmam@sangji.ac.kr, compiler.sangji.ac.kr Department of Computer Engineering Sang Ji University 2018 자바프로그램기본구조 Hello 프로그램구조 sec01/hello.java 2/40 자바프로그램기본구조 Hello 프로그램구조

More information

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20BBB7BBB7C7D15F FBEDFB0A3B1B3C0B05FC1A638C0CFC2F72E BC8A3C8AF20B8F0B5E55D> 뻔뻔한 AVR 프로그래밍 The Last(8 th ) Lecture 유명환 ( yoo@netplug.co.kr) INDEX 1 I 2 C 통신이야기 2 ATmega128 TWI(I 2 C) 구조분석 4 ATmega128 TWI(I 2 C) 실습 : AT24C16 1 I 2 C 통신이야기 I 2 C Inter IC Bus 어떤 IC들간에도공통적으로통할수있는 ex)

More information

Microsoft PowerPoint - CHAP-03 [호환 모드]

Microsoft PowerPoint - CHAP-03 [호환 모드] 컴퓨터구성 Lecture Series #4 Chapter 3: Data Representation Spring, 2013 컴퓨터구성 : Spring, 2013: No. 4-1 Data Types Introduction This chapter presents data types used in computers for representing diverse numbers

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx #include int main(void) { int num; printf( Please enter an integer "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 을 작성하면서 C 프로그램의

More information

<4D F736F F F696E74202D20332EB5F0C1F6C5D0C8B8B7CEBFCD20B1B8C7F62E >

<4D F736F F F696E74202D20332EB5F0C1F6C5D0C8B8B7CEBFCD20B1B8C7F62E > 디지털회로 디지털논리의표현 디지털회로 디지털회로구현 dolicom@naver.com http://blog.naver.com/dolicom 논리 논리게이트 논리게이트 논리게이트 (Logic gate) 또는 로구성된 2 진정보를취급하는논리회 (logic circuit) 일반적으로 2 개이상의입력단자와하나의출력단자 기본게이트 : AND OR NOT 기본게이트로부터

More information

VHDL 기초 VHDL 두원공과대학정보통신미디어계열이무영

VHDL 기초 VHDL 두원공과대학정보통신미디어계열이무영 기초 두원공과대학정보통신미디어계열이무영 2! 담당 : 이무영, 본관 325 호, mylee@doowon.ac.kr! 강의교재! 3 월 : 기존교재복습 ( 기초와응용, 홍릉과학출판사, 이대영외 3 명공저 )! 4 월이후 : 추후공지! 실습도구! 한백전자 HBE-DTK-240! www.hanback.co.kr ( 디지털 -FPGA) 자료참고할것임.! 천안공대류장열교수님온라인컨텐츠

More information

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074> Chap #2 펌웨어작성을위한 C 언어 I http://www.smartdisplay.co.kr 강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법

More information

Microsoft PowerPoint - VHDL08.ppt [호환 모드]

Microsoft PowerPoint - VHDL08.ppt [호환 모드] VHDL 프로그래밍 8. 조합논리회로설계 한동일 학습목표 테스트벤치의용도를알고작성할수있다. 간단한조합논리회로를설계할수있다. 하나의로직회로에대해서다양한설계방식을구사할수있다. 제네릭을활용할수있다. 로직설계를위한사양을이해할수있다. 주어진문제를하드웨어설계문제로변환할수있다. 설계된코드를테스트벤치를이용하여검증할수있다. 2/37 테스트벤치 (test bench) 테스트벤치

More information

Microsoft PowerPoint - 1-2장 디지털_데이터 .ppt

Microsoft PowerPoint - 1-2장 디지털_데이터 .ppt 1 장디지털개념 한국기술교육대학교정보기술공학부전자전공장영조 1.1 디지털과아날로그 아날로그 : 연속적인범위의값으로표현 디지털 : 2 진수의값에의해표시 < 아날로그파형 > < 디지털파형 > 2 1.2 논리레벨과펄스파형 양논리시스템 (positive logic system)- 일반적으로많이사용 1(high 레벨 ), 0(low 레벨 ) 로나타냄. 음논리시스템 (negative

More information

Microsoft PowerPoint - lec2.ppt

Microsoft PowerPoint - lec2.ppt 2008 학년도 1 학기 상지대학교컴퓨터정보공학부 고광만 강의내용 어휘구조 토큰 주석 자료형기본자료형 참조형배열, 열거형 2 어휘 (lexicon) 어휘구조와자료형 프로그램을구성하는최소기본단위토큰 (token) 이라부름문법적으로의미있는최소의단위컴파일과정의어휘분석단계에서처리 자료형 자료객체가갖는형 구조, 개념, 값, 연산자를정의 3 토큰 (token) 정의문법적으로의미있는최소의단위예,

More information

Microsoft PowerPoint - Perpect C 02.ppt [호환 모드]

Microsoft PowerPoint - Perpect C 02.ppt [호환 모드] 02 C 프로그래밍기초 충남대학교이형주 1 C 프로그램구조 콘솔응용프로그램 2 프로그램실행순서 C 프로그램은여러함수의조합으로구성 함수란정해진규칙에의하여일련의작업을수행하는프로그램의단위 실행순서 main 함수는프로그램이실행되면가장먼저시작되는부분 모든함수내부에서는위에서아래로, 좌에서우로, 문장이위치한순서대로실행 3 전처리기 전처리기 (preprocessor) 미리처리하는프로그램으로,

More information

Microsoft PowerPoint - ICCAD_Analog_lec01.ppt [호환 모드]

Microsoft PowerPoint - ICCAD_Analog_lec01.ppt [호환 모드] Chapter 1. Hspice IC CAD 실험 Analog part 1 Digital circuit design 2 Layout? MOSFET! Symbol Layout Physical structure 3 Digital circuit design Verilog 를이용한 coding 및 function 확인 Computer 가알아서해주는 gate level

More information

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770>

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770> 연습문제해답 5 4 3 2 1 0 함수의반환값 =15 5 4 3 2 1 0 함수의반환값 =95 10 7 4 1-2 함수의반환값 =3 1 2 3 4 5 연습문제해답 1. C 언어에서의배열에대하여다음중맞는것은? (1) 3차원이상의배열은불가능하다. (2) 배열의이름은포인터와같은역할을한다. (3) 배열의인덱스는 1에서부터시작한다. (4) 선언한다음, 실행도중에배열의크기를변경하는것이가능하다.

More information

PHPoC vs PHP > 개요 개요 PHPoC 는솔내시스템 이자체개발한프로그래밍언어입니다. 당사의모든 PHPoC 제품들의펌웨어에는 PHPoC 인터프리터가내장되어있습니다. PHPoC 는범용스크립트언어인 PHP 를기반으로제작되었습니다. PHPoC 는매우간단하여 C 언어등

PHPoC vs PHP > 개요 개요 PHPoC 는솔내시스템 이자체개발한프로그래밍언어입니다. 당사의모든 PHPoC 제품들의펌웨어에는 PHPoC 인터프리터가내장되어있습니다. PHPoC 는범용스크립트언어인 PHP 를기반으로제작되었습니다. PHPoC 는매우간단하여 C 언어등 PHPoC vs PHP > 개요 개요 PHPoC 는솔내시스템 이자체개발한프로그래밍언어입니다. 당사의모든 PHPoC 제품들의펌웨어에는 PHPoC 인터프리터가내장되어있습니다. PHPoC 는범용스크립트언어인 PHP 를기반으로제작되었습니다. PHPoC 는매우간단하여 C 언어등프로그래밍언어에대한경험이있는사람이라면누구나쉽게사용할수있습니다. PHPoC 는기본적으로 PHP

More information

untitled

untitled Logic and Computer Design Fundamentals Chapter 4 Combinational Functions and Circuits Functions of a single variable Can be used on inputs to functional blocks to implement other than block s intended

More information

. 고성능마이크로프로세서 LU 와레지스터 파일의구조 (2.). 직접디지털주파수합성기 (FS) 의구조 3. 고성능마이크로프로세서부동소수점연산기 (Floating-Point Unit) 구조 (2) (2.) (2.) 2. 암호화를위한 VLSI 구조와설계의개요 (2.) 다음참

. 고성능마이크로프로세서 LU 와레지스터 파일의구조 (2.). 직접디지털주파수합성기 (FS) 의구조 3. 고성능마이크로프로세서부동소수점연산기 (Floating-Point Unit) 구조 (2) (2.) (2.) 2. 암호화를위한 VLSI 구조와설계의개요 (2.) 다음참 이비디오교재는정보통신부의 999년도정보통신학술진흥지원사업에의하여지원되어연세대학교전기전자공학과이용석교수연구실에서제작되었습니다 고성능마이크로프로세서 LU ( rithmetic Logic Unit) 와 Register File의구조 2. 연세대학교전기전자공학과이용석교수 Homepage: http://mpu.yonsei.ac.kr E-mail: yonglee@yonsei.ac.kr

More information

CPX-E-SYS_BES_C_ _ k1

CPX-E-SYS_BES_C_ _ k1 CPX-E 8727 27-7 [875294] CPX-E-SYS-KO CODESYS, PI PROFIBUS PROFINET (). :, 2 Festo CPX-E-SYS-KO 27-7 ... 5.... 5.2... 5.3... 5.4... 5.5... 5 2... 6 2.... 6 2..... 6 2..2 CPX-E... 7 2..3 CPX-E... 9 2..4...

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

Microsoft PowerPoint - C++ 5 .pptx

Microsoft PowerPoint - C++ 5 .pptx C++ 언어프로그래밍 한밭대학교전자. 제어공학과이승호교수 연산자중복 (operator overloading) 이란? 2 1. 연산자중복이란? 1) 기존에미리정의되어있는연산자 (+, -, /, * 등 ) 들을프로그래머의의도에맞도록새롭게정의하여사용할수있도록지원하는기능 2) 연산자를특정한기능을수행하도록재정의하여사용하면여러가지이점을가질수있음 3) 하나의기능이프로그래머의의도에따라바뀌어동작하는다형성

More information

Microsoft PowerPoint - ICCAD_Digital_lec02.ppt [호환 모드]

Microsoft PowerPoint - ICCAD_Digital_lec02.ppt [호환 모드] IC-CAD CAD 실험 Lecture 2 장재원 주문형반도체 (ASIC * ) 설계흐름도개요 Lecture 1 REVIEW ASIC Spec. Front-end design Logic design Logic synthesis Behavioral-level design Structural-level design Schematic editor *Analog 회로설계시

More information

Microsoft PowerPoint - Chapter_04.pptx

Microsoft PowerPoint - Chapter_04.pptx 프로그래밍 1 1 Chapter 4. Constant and Basic Data Types April, 2016 Dept. of software Dankook University http://embedded.dankook.ac.kr/~baeksj 이장의강의목표 2 기본자료형문자표현방식과문자자료형상수자료형변환 기본자료형 (1/8) 3 변수 (Variables)

More information

MAX+plusⅡ를 이용한 설계

MAX+plusⅡ를 이용한 설계 Digital System Design with Verilog HDL - Combinational Logic Lab. Gate Circuit AND, OR, NOT 게이트들로이루어진멀티플렉서기능의논리회로구현멀티플렉서 : 여러개의입력중하나를선택하여출력하는기능모듈입력 s=: 단자 a 의값이단자 z 로출력입력 s=: 단자 b 의값이단자 z 로출력 File name

More information

2 장수의체계 1. 10진수 2. 2진수 3. 8진수와 16진수 4. 진법변환 5. 2진정수연산과보수 6. 2진부동소수점수의표현 한국기술교육대학교전기전자통신공학부전자전공 1

2 장수의체계 1. 10진수 2. 2진수 3. 8진수와 16진수 4. 진법변환 5. 2진정수연산과보수 6. 2진부동소수점수의표현 한국기술교육대학교전기전자통신공학부전자전공 1 장수의체계. 진수. 진수 3. 8진수와 6진수 4. 진법변환 5. 진정수연산과보수 6. 진부동소수점수의표현 진수 진수표현법 v 기수가 인수 v,,, 3, 4, 5, 6, 7, 8, 9 사용 9345.35 = 9 3 4 5 3. 5. = 9 3 3 4 5 3-5 - v 고대로마의기수법에는 5 진법을사용 v 진법의아라비아숫자는인도에서기원전 세기에발명 진법을나타내는기본수를기수

More information

hwp

hwp BE 8 BE 6 BE 4 BE 2 BE 0 y 17 y 16 y 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 0 BE 7 BE 5 BE 3 BE 1 BE 16 BE 14 BE 12 BE 10 y 32 y 31 y 30 y 29 y 28 y 27 y 26 y 25 y 24 y 23

More information

한국기술교육대학교장영조 한국기술교육대학교전기전자통신공학부 1

한국기술교육대학교장영조 한국기술교육대학교전기전자통신공학부 1 한국기술교육대학교장영조 한국기술교육대학교전기전자통신공학부 1 본슬라이드는 M. Morris Mano and Charles Kime 의 Logic and Computer Design Fundamentals 의내용을참조하였습니다. 한국기술교육대학교전기전자통신공학부 2 1. 레지스터전송과데이터처리장치 2. 순차진행과제어 3. 명령어구조 (Instruction Set

More information

tut_modelsim(student).hwp

tut_modelsim(student).hwp ModelSim 사용법 1. ModelSim-Altera 를이용한 Function/RTL 시뮬레이션 1.1. 테스트벤치를사용하지않는명령어기반시뮬레이션 1.1.1. 시뮬레이션을위한하드웨어 A B S C 그림 1. 반가산기 1.1.2. 작업디렉토리 - File - Change Directory 를클릭하여작업디렉토리지정. 1.1.3. 소스파일작성 - 모델심편집기나기타편집기가능

More information

슬라이드 1

슬라이드 1 3. 자료와변수 3.1 자료형 자료형 컴퓨터는숫자 (= 데이터 ) 를다룬다. 컴퓨터가다룰수있는숫자의유형이있다. C 언어에서의자료형 크기 (byte) 정수형 ( 문자형 ) char 1 정수형 실수형 ( 부동소수형 ) short 2 int 4 long 4 long long 8 float 4 double 8 long double 8 / 16 강 C 프로그래밍 3

More information

예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = B = >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = >> tf = (A==B) % A

예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = B = >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = >> tf = (A==B) % A 예제 1.1 ( 관계연산자 ) >> A=1:9, B=9-A A = 1 2 3 4 5 6 7 8 9 B = 8 7 6 5 4 3 2 1 0 >> tf = A>4 % 4 보다큰 A 의원소들을찾을경우 tf = 0 0 0 0 1 1 1 1 1 >> tf = (A==B) % A 의원소와 B 의원소가똑같은경우를찾을때 tf = 0 0 0 0 0 0 0 0 0 >> tf

More information

Microsoft PowerPoint - a10.ppt [호환 모드]

Microsoft PowerPoint - a10.ppt [호환 모드] Structure Chapter 10: Structures t and Macros Structure 관련된변수들의그룹으로이루어진자료구조 template, pattern field structure를구성하는변수 (cf) C언어의 struct 프로그램의 structure 접근 entire structure 또는 individual fields Structure는

More information

<4D F736F F F696E74202D C61645FB3EDB8AEC7D5BCBA20B9D720C5F8BBE7BFEBB9FD2E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D C61645FB3EDB8AEC7D5BCBA20B9D720C5F8BBE7BFEBB9FD2E BC8A3C8AF20B8F0B5E55D> VHDL 프로그래밍 D. 논리합성및 Xilinx ISE 툴사용법 학습목표 Xilinx ISE Tool 을이용하여 Xilinx 사에서지원하는해당 FPGA Board 에맞는논리합성과정을숙지 논리합성이가능한코드와그렇지않은코드를구분 Xilinx Block Memory Generator를이용한 RAM/ ROM 생성하는과정을숙지 2/31 Content Xilinx ISE

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

歯처리.PDF

歯처리.PDF E06 (Exception) 1 (Report) : { $I- } { I/O } Assign(InFile, InputName); Reset(InFile); { $I+ } { I/O } if IOResult 0 then { }; (Exception) 2 2 (Settling State) Post OnValidate BeforePost Post Settling

More information

Microsoft PowerPoint - M07_RTL.ppt [호환 모드]

Microsoft PowerPoint - M07_RTL.ppt [호환 모드] 제 7 장레지스터이동과데이터처리장치 - 디지털시스템의구성 data path 모듈 : 데이터처리, 레지스터, 연산기, MUX, control unit 모듈 : 제어신호발생, 연산의순서지정 - register transfer operation : reg 데이터이동 / 처리 reg set,operation, sequence control - micro-operation

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 14. 포인터와함수에대한이해 2013.10.09. 오병우 컴퓨터공학과 14-1 함수의인자로배열전달 기본적인인자의전달방식 값의복사에의한전달 val 10 a 10 11 Department of Computer Engineering 2 14-1 함수의인자로배열전달 배열의함수인자전달방식 배열이름 ( 배열주소, 포인터 ) 에의한전달 #include

More information

Microsoft PowerPoint - o8.pptx

Microsoft PowerPoint - o8.pptx 메모리보호 (Memory Protection) 메모리보호를위해 page table entry에 protection bit와 valid bit 추가 Protection bits read-write / read-only / executable-only 정의 page 단위의 memory protection 제공 Valid bit (or valid-invalid bit)

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 2015-1 프로그래밍언어 7. 포인터 (Pointer), 동적메모리할당 2015 년 4 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) Outline 포인터 (pointer) 란? 간접참조연산자

More information

<BFACBDC0B9AEC1A6C7AEC0CC5F F E687770>

<BFACBDC0B9AEC1A6C7AEC0CC5F F E687770> IT OOKOOK 87 이론, 실습, 시뮬레이션 디지털논리회로 ( 개정 3 판 ) (Problem Solutions of hapter 7) . 반감산기와전감산기를설계 반감산기반감산기는한비트의 2진수 에서 를빼는회로이며, 두수의차 (difference, ) 와빌림수 (barrow, ) 를계산하는뺄셈회로이다. 에서 를뺄수없으면윗자리에서빌려와빼야하며, 이때빌려오는수는윗자리에서가져오므로

More information

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf(hihi\n); } warning: conflicting types for functiona 이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.

More information

Microsoft PowerPoint - chap-03.pptx

Microsoft PowerPoint - chap-03.pptx 쉽게풀어쓴 C 언어 Express 제 3 장 C 프로그램구성요소 컴퓨터프로그래밍기초 이번장에서학습할내용 * 주석 * 변수, 상수 * 함수 * 문장 * 출력함수 printf() * 입력함수 scanf() * 산술연산 * 대입연산 이번장에서는 C프로그램을이루는구성요소들을살펴봅니다. 컴퓨터프로그래밍기초 2 일반적인프로그램의형태 데이터를받아서 ( 입력단계 ), 데이터를처리한후에

More information

v6.hwp

v6.hwp 93 6 장순차회로모델링 이장에서는앞에서배운여러가지모델링방법에대한지식을바탕으로많이사용되는기본적인순차회로블록들의모델링과순차회로설계방법에대해서배운다. 6. 레지스터 레지스터는 n-bit 데이터를저장하는기억소자이다. 데이터의저장은클럭에동기가되어이루어진다. 그림 6.은전형적인레지스터의블록도와동작표이다. register D D D2 D3 Load Reset Q Q Q2

More information

쉽게

쉽게 Power Java 제 4 장자바프로그래밍기초 이번장에서학습할내용 자바프로그램에대한기초사항을학습 자세한내용들은추후에. Hello.java 프로그램 주석 주석 (comment): 프로그램에대한설명을적어넣은것 3 가지타입의주석 클래스 클래스 (class): 객체를만드는설계도 ( 추후에학습 ) 자바프로그램은클래스들로구성된다. 그림 4-1. 자바프로그램의구조 클래스정의

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 생체계측 디지털논리회로 Prof. Jae Young Choi ( 최재영교수 ) 생체계측 (2014 Fall) Prof. Jae Young Choi Section 01 논리게이트 디지털컴퓨터에서모든정보는 0 또는 1 을사용하여표현 게이트 (gate) 0, 1 의이진정보를처리하는논리회로여러종류가존재동작은부울대수를이용하여표현입력과출력의관계는진리표로표시 2 ND 게이트

More information

Microsoft PowerPoint - verilog_intro and project example_실험4까지 설명후 project 진행_66 [호환 모드]

Microsoft PowerPoint - verilog_intro and project example_실험4까지 설명후 project 진행_66 [호환 모드] Verilog HDL Intro. . Overview ..2 HDL HDL (hardware description language) : 하드웨어를기술하고시뮬레이션, 합성을하기위해고안된프로그래밍언어 ex.) Verilog HDL, VHDL Advantages of HDL - Easy to describe hardware system - Easy to convert

More information

Computer Architecture

Computer Architecture 정수의산술연산과부동소수점연산 정수의산술연산부동소수점수의표현부동소수점산술연산 이자료는김종현저 - 컴퓨터구조론 ( 생능출판사 ) 의내용을편집한것입니다. 3.5 정수의산술연산 기본적인산술연산들 2 2 3.5.1 덧셈 2 의보수로표현된수들의덧셈방법 두수를더하고, 만약올림수가발생하면버림 3 3 병렬가산기 (parallel adder) 덧셈을수행하는하드웨어모듈 4- 비트병렬가산기와상태비트제어회로

More information