�������� ������: �������� ������ ������� �������
��������: �������� ������ ������� ������� ������: �������� �� ����������� ���: �������� ������ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
�������� ������ �� ����������: ������ �������������� �������� ��������� �� ���� ������� ������� �.�. ��������� ��������������� ���������������� ����������� ������ 2008 �. �������� � ������ �������� ������ �(?!) ���� ������������� � ������������ �������� ������ ������� ������� (���). �������������� ����� ������� ������� � �������� �������������� �������. ������ ����� �������� �� ������ ��������������� ���������� ������������ ����� EPF10K20RC240-4 �� ��������� FLEX10K ����� Altera � ������� ����������� �������� MAX+plus II 10.2 BASELINE � MATLAB 6.5. ���� �������� FLEX10K - ����� ���������� ���������� ���� ��� ���������� ���������� ���. �� ����� ���������� ���, ��� ��� ����� ������� ���������� �������, ������� ����������� � ����������� ������� ������(EAB, Embedded Array Block), ������� ���������� � ���������� ����, ������������ ������ ����. ����� ���������� ��� ������� �������, ����������� � �������������. ������, ������������ � ������������ ������ � ������ ������ �(?!) ���� ������������� ������ ������ � ����������� ���������� ��������������� �������� �������. ������� �������� ���������� ��������� ��� ���-�������:
����������� ������ ��������� � �������� ��� ����� ���������� ���-�������: 1)������ ����� 1
2)������ ����� 2
3)����������������� ������ ����� 2
��� ������� ������� �=3 �������: ��������������� ����� ���������� ��������, ������� � ������, ��� ����� ������������ ����������������� ������ ����� 2,��� ��� ����� ���������� �������� � ���������� ���������� ����������(?!). ������ ����� ����� ����������� � ���� ���� ������, ������� �� � ����������� � ����� ������������ ��� ����������������: ���.4 ���� Mult_a ���.5 ���� Mult_b ���.6 ���� Mult_c ��������������� ����� ���� ����� Altera FLEX10K20RC240-4.������ �������������� ���� �����:
������� 1 � ������� ���� �������� ������������ �������. �� ��� ������� � ������� MAX+plus � ���� �������� �� �����. ���������� �� ��������� � ����� �����. ��� ������������ � ������� ���������������. ��������������� ������������� ������������ ����� ��������� �������� ������������� ai �� 2m � bi �� 2n. �������� n � m ���, ����� ����������� ������� ������������ �������(���������� ��� � ������ ����������� � ��������� ��� � ������ �������������). � ������ ����� ������� m=n=6. ���������� MATLAB � �������� �������������� ������� ��� ��������� �����������: -��� ���������� -� ������������� ������� ����� (fix); -� ����������� �� ���������� ������ (round); -� ����������� �� ���������� �������� ������ (floor); -� ����������� �� ���������� �������� ������ (ceil); �������� ���������� �� ���������� ������, ��� ��� ��� ������������ ����������, ������� ������������� ������������ �������. ��� ������������� �������� �������. (���������� ��� � ������ �����������: �� ����� � 0,6 �� ��������� ��� � ������ �������������: �� ����� 29 ��) (���������� �������� �������� ����������!!) ���.10 ���������� �������������� ������� ���.11 ���������� �������������� ������� ���.12 ��� ������� ���.13 ����� ����� � ������� ������� ������ ������ �������� ����������, ��� ��� ��� ������ ��������� ������ ��������� ����������. ������� ����������� � ������������������ ������������:
������� 2(??) (��� ������������ �������������??) ������� �������� ���������� � ���������� �������������:
������� 3 ���������� � ����������� ����������� ����� ���������� ������-��� �������� ���� ��� ���������� ������������ �������. ��� ������ ������ ���������� �������������� ���. �� ������������ ������� �� ����� ����� 8-��������� ������������ ������ ���. ������� ����� �������� ������������� ��������� ��������������� ������� ���� � �������������� ���. ��� ��� ������ �� ���� ������� ��������� � ���������� ����������, ��� ������������ ������ ��������� ��������� 8-��������� ������������ �������. ����� �������� ����� ��� �������� ���������� �������� �� ���������� ��������, ���������� ���� ������������� ������� ���� ��� ���������� ������ �������. ��� ��� ������ ���� ����������� ������, �� �� ������ ��� �� �������� ������������ ������� (����������� ������������ ����������� ��������, �.� �������� ������������ ������� ����� 16-���������). �������������� ����������(�� ���) ��������� �������������� ������ ����. ��� ��������� ������� ������� ��������� ������� � ������� ��� ������������ �����. ��������������� ������� ������� ������� � ������ ���������� ����. ������� �������� ������ ����������� ����� : 1. btn � ��������������� ����� � ��������������� ������������ ������� � ����������. 2. reg_in � reg_out ������������� ������������������� �������� 3. preobr_cod � ��������������� ���� , ������������ ��� �������������� �������� ������� ���� � �������������� ���; 4. filter_gor � �������� ���� �������������� 5. tffe-������� 6. l7segment � h7segment � �������������� ����������(?!), ���������� ��� �������� ������ ����������. ���.14 ����������� ����� ���������� ����������� � �������� �������������� ����� ����������. ���������� � ������� ��������� �� ����� AHDL ��� ���������������� ���� ��������� FLEX10K ���������� ��������� �������: ��������� ���������������� (���������������� ���, ByteBlaster, BiteBlaster, JTAG, ���������������); ��������� ������������ ���������� (���������������); ��������� ������������ ���������� (���������������); � ������� ����� ������������ JTAG ����������������. ��� ���������������� ����������� JTAG ������ MSEL0, MSEL1 ���������� ���������� � �����. JTAG (Joint Test Action Group) - ������������ ������ �� �������� ������������ � ����������� ������������ ��� ������������� ������������ (BST � Boundary Scan Test). BST-���������� ��������� ��������� ����������� ������������ ����������� �� ������������ �������� ������. BST-���������� ����� ����������� ������ ��� ������������� ����� � ��������� � ��������� ���� ����������� �������������� ������ � ���������� ������ ���������������� ����������. ��� ������ � JTAG-������ ������������ ������ ���������� ������: TDI, TDO, TMS, � TCK, � ��������������� ����� TRST. ��� ��������� ������ �� ����� JTAG-���������������� ��������� � ������� ���������. JTAG-���������������� ������ �������� �� ���������� ������ ������� ����������������. �� ����� JTAG-���������������� ���������������� ������ ����������� � ���������� �� �������� ����� ����� ������� ������� MasterBlaster ��� ByteBlasterMV. 1)TDI � ���� �������� ������.( ���� ���������������� �������� ����������, ��������������� � �������� ������. ������ ���������������� ������� ��������� �� ������ TCK.) 2)TDO � ����� �������� ������.( ���������������� ����� ����������, ��������������� � �������� ������. ������ ���������������� ������ ��������� �� ������ TCK. ���� ������ �� ���������� �� ��������� - ����� ��������� � ������� ���������) 3)TMS � ����� ������ ������������ (����� ����������� BST)( ���� ���������� ������� ��������� �������� (�����������) TAP. �������� ������� ���������������� ������� ������� �� ����� TCK. ������� ��������� ������ TMS ������ ���� ����������� ����� ������� ������� TCK.) 4)TCK � �������� ���� ����������� BST(�������� ���������� ����� BST. ��������� �������� ���������������� �������, � ��������� ������ ������� �� TCK.) 5) TRST� ���� ����������� ������������ (��������������)( ���� ������������ ������ ����� ������������� ������������."0" �� ������ � ���������� BST-����� ������������� ������������. ����� TRST �������� �������������� � ������������ �� ���������� IEEE STD. 1149.1.)[2] (����� ��������� ����� ���������� �������� � �������??) ��� ���������� ��������� ������������� �������� �� ����� AHDL ��������� ������: 1)��������������� ���� �� ������� � ��������������(���?): ���� ������� ��� ������� ������ ����� ����, �� ��� �� ����������, ���� ����� �������,�� ��� ������� ����� �������� �������������, � ����� � �������� ������������ �������. 2)��������������� �����(���?): �� ������ �������� ����� (��� ��? �������� �����! ������, ��� ���������� �������) �� ��������� ������� ���������� �������, ��� ��������� ���������� ��������� �������� �� ������ ������ ��������������� � ����.� ����� �� ������ �������� ������� ������������� � ���� ����, ������� ��������� �� ����� �� ������ ������� � ������� ��������� ������������ ��������� ��������. ������ ������������ ����� ��� ������� �� ������. 3) �������� ���� �����-������(���?): ������� 8-�� ��������� ������������������ ���������� �� �������� ������������ ��������� � ������������ � ������������� ������������� �����������, ������ � ��������������� ������, � ������������������ 16-�� ��������� ����������. (��� ����������� 16-��������� ���?? ��� �������������� ������?) ����������� ������� ������� � ���������� ��������� �������, � ������ ������ ������������ 3 ������. ��� ��������� ���� �� ������. 4)������������ ������������������� ��������(���?) �������������� ��� �������� ���������� � ������� ������� ������� ������������� 5)�������������� ���������(?!) (���?) ���������� ���������������� ������. (���������� ������� �� ������������� ��������.) ����������, ����� ������� (���) ����������� �������� (��������, �����, ������), �������������� �� ����������� �����. ��� ����� ������� � ����: ���������� ������ � �� �������� . �������� �������� ��������� �� ����� AHDL � �����������; ����������� ���� � �� ��������. �������� �������� ����������� ����� �� ����� AHDL � �����������; ���������� �������� �� ����� AHDL � �� ��������. ��� �������� ������ ���������� �������� ��������� ��������� ������ ����� (������, ��������, ��������) ����������� ��������������, ���������� � ���������� ������������� ���������� ��������������� ��������������(����� �������??), �������� ��������� ������: -������ �������� ���������-115.8 �� -������� �������������-8.63 ��� �� �������: ������� �������������: 2,8 ��� ��������������, �������� ������� ����� �� �������: 8.63-2.8=5.83 ���. ������� �������� �������� ���������� � ���������� �������������,���������� � ������� MAX+PLUS II, MATLAB � ����������� ������. ��� ���������� ��� �������� ������������ ������ ����� ����������.
������� 4 ������� ���������� ��������������
������� 5 ������� ���������� �������������� ������������ ������� �������� ����� ������� ������ ���������� ��������(??), ���������� �� ��������������� ����) �� 6400(��� ��� �������������� ����������� 26 =64 � ��������� �������� ����������� ������� ������ 100). (��� �������� ������������� ��������?) ���������� � ������ ������ ��� ������������� �������� ������ ������� �������, ��������������� ���� ����������� ������������ �������. ������ ����� �� ������������ ����� 60% �������� ��� 694 ���������� �����. ���� �������� ������ ���������������� ����. ����������� ������������� ������� ������� � ����������� ��� �������������. (??) (��� ��������� ���������� ��?) ������ ���������� ������� �.�. �������� ������������: ������� �������. �����-���������(?������������?) 2000 �. ���������������� ���� Altera �� ����������� ������� ������������. �.�. �����. �����-��������� (?������������?) 2003 �. �������� �.�. ���� ����� ALTERA: ���������� ����, ������� �������������� � ����� �������� ����������. �., ������-XXI, 2007 (2002). ������� �.�. ���� �������� �������� ��������� Altera AHDL. :������������ ����. �., ����� ����, 2001 �. ���������� % �������� ������ �� ����������: "������ �������������� �������� ��������� �� ����" �� ����: "�������� ������ ������� �������" ��������: ������� ������ 5110 ������� �.�. ��������: ������� �.�. % include "filter.inc"; include "button.inc"; include "ppreg.inc"; include "pk_dk.inc"; include "7segment.inc"; constant razx = 8;--��� �������� ����������� ���������? constant razy = 16;--������ ��� ���������? constant razb = 4; constant raza = 8; subdesign final ( data[razx-1..0],clk,knopka : input; reset : input = gnd; out[razy-1..0] : output; synhr,h : output; la,lb,lc,ld,le,lf,lg : output; ha,hb,hc,hd,he,hf,hg : output; ) variable preobr_cod : pk_dk with (width = razx); h7seg,l7seg : 7segment; reg_in : ppreg with (width = razx); reg_out : ppreg with (width = razy); btn : button with ( delay = 1, clock = 3175); --8000 25175 filtr_gor : filter with ( wx = 8, --��������������� xn wy = 16, --����������� ���� yn������� ��������� ���������?? wc1 = 5, -- ����������� ������������� b wc2 = 7, -- ����������� ������������� a rs = 6, --���������� ������������ b ws = 23, --����������� ���� sum wp = 23, --����������� ���� result b1 = 8, --����������� b1 b2 = B"10010", --����������� b2 b3 = 14, --����������� b3 b4 = B"11000", --����������� b4 a2 = B"1000101", --����������� a2 a3 = B"1000111", --����������� a3 a4 = B"1101110", --����������� a4 wm = 6 ��������� ������ ��������? );--�������� ���������� �� ��������� � ������������� �������!! ce : node; begin reg_in.(clk,reset)=(clk,!reset); reg_out.(clk,reset)=(clk,!reset); btn.clk = clk; filtr_gor.(clk,reset)=(clk,!reset); preobr_cod.in[] = data[]; reg_in.data[] = preobr_cod.out[]; filtr_gor.vxod[]=reg_in.out[]; reg_out.data[]=filtr_gor.vixod[]; out[]=reg_out.out[]; l7seg.i[]=out[3..0]; h7seg.i[]=out[7..4]; (la,lb,lc,ld,le,lf,lg) = l7seg.(a,b,c,d,e,f,g); (ha,hb,hc,hd,he,hf,hg) = h7seg.(a,b,c,d,e,f,g); btn.btn = knopka; ce = btn.out; filtr_gor.ce = ce; reg_in.ce = ce; reg_out.ce = ce; synhr = ce; h = tffe(VCC,clk, , ,ce); end; % ������ �������� ��.��.� 5110 ��������.�. % include "mult_a1.inc"; include "mult_b.inc"; include "mult_c.inc"; PARAMETERS ( wx = 8, --��������������� xn wy = 16, --��������������� yn wc1 = 5, -- ����������� ������������� b wc2 = 7, -- ����������� ������������� a rs = 6, --���������� ������������ b ws = 23, --����������� ���� sum wp = 23, --����������� ���� result b1 = 8, --����������� b1 b2 = B"10010", --����������� b2 b3 = 14, --����������� b3 b4 = B"11000", --����������� b4 a2 = B"1000101", --����������� a2 a3 = B"1000111", --����������� a3 a4 = B"1101110", --����������� a4 wm = 6 --����� ); subdesign filter ( vxod[wx-1..0], clk : input; ce : input=vcc; reset : input=gnd; vixod[wy-1..0] : output; ) variable sec_up : mult_a1 with (widthx = wx, widthc = wc1+rs, widths = ws, widthp = wp, bn= b1*(2^rs)); sec_mid1 : mult_b with (widthx = wx, widthy = wy, widthc1 = wc1+rs, widthc2=wc2, widthp = wp, an = a2, bn = b2*(2^rs)); sec_mid2 : mult_b with (widthx = wx, widthy = wy, widthc1 = wc1+rs, widthc2=wc2, widthp = wp, an = a3, bn = b3*(2^rs)); sec_down : mult_c with (widthx = wx, widthy = wy, widthc1 = wc1+rs, widthc2=wc2, widthp = wp, an = a4, bn = b4*(2^rs)); V[wy-1..0] : node; begin sec_mid1.(clock,clken,aclr) = (clk,ce,reset); sec_mid2.(clock,clken,aclr) = (clk,ce,reset); sec_down.(clock,clken,aclr) = (clk,ce,reset); sec_up.xn[]=vxod[]; sec_mid1.xn[]=vxod[]; sec_mid2.xn[]=vxod[]; sec_down.xn[]=vxod[]; V[] = sec_up.result[wm+wy-1..wm]; sec_mid1.yn[]=V[]; sec_mid2.yn[]=V[]; sec_down.yn[]=V[]; sec_up.sum[]=sec_mid1.result[]; sec_mid1.sum[]=sec_mid2.result[]; sec_mid2.sum[]=sec_down.result[]; vixod[]=V[]; end; % ��������������� ���� �� ������� � �������������� �������� ��.��.� 5110 ������� �.�. % parameters ( width=8 ); subdesign pk_dk ( in[width-1..0] : input; out[width-1..0] : output; ) variable sign : node; begin sign = in[width-1] ; if sign then out[] = (sign,!in[width-2..0])+1; else out[] = in[]; end if; end; % ������������ ������������������� ������� �������� ��.��.� 5110 ��������.�. % PARAMETERS ( width=8 ); SUBDESIGN ppreg ( data[width-1..0],clk : input; ce : input = vcc; reset : input = gnd; out[width-1..0] : output; ) variable out[width-1..0] : dffe; begin out[].(clk,clrn,ena)=(clk,!reset,ce); out[] = data[]; end; % ����������� ����������.��.� 5110 ������� �.�. % PARAMETERS ( delay = 1 --�������� ������� � ������������� , clock = 5175 -- �������� ������� � ���������� ); CONSTANT modul = (delay*clock) DIV 1000;-- ����������� ASSERT (modul>2) REPORT "������������ delay*clock ������ ���� ������ 2000" SEVERITY ERROR; CONSTANT width = LOG2(modul); CONSTANT end_state = modul-1; SUBDESIGN button ( btn : INPUT; clk : INPUT; out : OUTPUT; ) VARIABLE div_out : NODE; astart : NODE; tr[width-1..0] : dffe; BEGIN tr[].(clk, ena) = (clk, astart); astart = dff(VCC, !btn, div_out, ); IF tr[].q < end_state THEN tr[].d = tr[].q + 1; ELSE tr[].d = 0; END IF; div_out = !dff((tr[].q == end_state),clk,,); --���������������������������������� out = dff(dff(VCC, astart,!out,), clk, ,); --�������������������� END; % ������ �������������� ������ ��� ������������� �� �������������� ���������� ���� �� ������������ ��������� % % -a- % % f| |b % % -g- % % e| |c % % -d- % % % % 0 1 2 3 4 5 6 7 8 9 A b C d E F % % % SUBDESIGN 7segment ( i[3..0] : INPUT; a, b, c, d, e, f, g : OUTPUT; ) BEGIN TABLE i[3..0] => a, b, c, d, e, f, g; H"0" => 1, 1, 1, 1, 1, 1, 0; H"1" => 0, 1, 1, 0, 0, 0, 0; H"2" => 1, 1, 0, 1, 1, 0, 1; H"3" => 1, 1, 1, 1, 0, 0, 1; H"4" => 0, 1, 1, 0, 0, 1, 1; H"5" => 1, 0, 1, 1, 0, 1, 1; H"6" => 1, 0, 1, 1, 1, 1, 1; H"7" => 1, 1, 1, 0, 0, 0, 0; H"8" => 1, 1, 1, 1, 1, 1, 1; H"9" => 1, 1, 1, 1, 0, 1, 1; H"A" => 1, 1, 1, 0, 1, 1, 1; H"B" => 0, 0, 1, 1, 1, 1, 1; H"C" => 1, 0, 0, 1, 1, 1, 0; H"D" => 0, 1, 1, 1, 1, 0, 1; H"E" => 1, 0, 0, 1, 1, 1, 1; H"F" => 1, 0, 0, 0, 1, 1, 1; END TABLE; END; % ������ mult_a1 ���� �� ������������ ��������� % INCLUDE "lpm_mult.inc"; PARAMETERS ( widthx = 8, --����������������� xn[] widthc = 10, --����� �������� ������������� widths = 18, --����� �������� ���� sum[] widthp = 18, --����� �������� ���� result[] bn = 100 --����������� bn ��������� ); SUBDESIGN mult_a1 ( xn[widthx-1..0] : INPUT; sum[widths-1..0] : INPUT; result[widthp-1..0] : OUTPUT; ) VARIABLE mult_x : lpm_mult WITH ( LPM_WIDTHA = widthx, LPM_WIDTHB = widthc, LPM_WIDTHP = widthp, LPM_WIDTHS = widths, INPUT_B_IS_CONSTANT = "YES", LPM_REPRESENTATION = "SIGNED", USE_EAB = "OFF", --LPM_PIPELINE = 1, MAXIMIZE_SPEED = 6 ); BEGIN mult_x.dataa[] = xn[]; mult_x.datab[] = bn; mult_x.sum[] = sum[]; result[] = mult_x.result[]; END; % ������ mult_b ���� �� ������������ ��������� % INCLUDE "lpm_mult.inc"; PARAMETERS ( widthx = 8, --����� �������� ���� xn[] widthy = 8, --����� �������� ���� yn[] widthc1 = 10, --����� �������� ������������� b widthc2 = 10, --����� �������� ������������� � widthp = 18, --����� �������� ���� result[] an = 100, --����������� -an ����������� (������������� - hex) bn = 100 --����������� bn ��������� ); CONSTANT widths= widthp; SUBDESIGN mult_b ( xn[widthx-1..0] : INPUT; yn[widthy-1..0] : INPUT; sum[widths-1..0] : INPUT; clock : INPUT; clken : INPUT = VCC; aclr : INPUT = GND; result[widthp-1..0] : OUTPUT; ) VARIABLE mult_x : lpm_mult WITH ( LPM_WIDTHA = widthx, LPM_WIDTHB = widthc1, LPM_WIDTHP = widthp, LPM_WIDTHS = widths, INPUT_B_IS_CONSTANT = "YES", LPM_REPRESENTATION = "SIGNED", USE_EAB = "OFF", LPM_PIPELINE = 1, MAXIMIZE_SPEED = 6 ); mult_y : lpm_mult WITH ( LPM_WIDTHA = widthy, LPM_WIDTHB = widthc2, LPM_WIDTHP = widthp, LPM_WIDTHS = widths, INPUT_B_IS_CONSTANT = "YES", LPM_REPRESENTATION = "SIGNED", USE_EAB = "OFF", --LPM_PIPELINE = 1, MAXIMIZE_SPEED = 6 ); BEGIN mult_x.(clock, clken, aclr) = (clock, clken, aclr); mult_x.dataa[] = xn[]; mult_x.datab[] = bn; mult_x.sum[] = mult_y.result[]; result[] = mult_x.result[]; mult_y.dataa[] = yn[]; mult_y.datab[] = an; mult_y.sum[] = sum[]; END; % ������ mult_c ���� �� ������������ ��������� % INCLUDE "lpm_mult.inc"; PARAMETERS ( widthx = 8, --����� �������� ���� xn[] widthy = 8, --����� �������� ���� yn[] widthc1 = 10, --����� �������� ������������� b widthc2 = 10, --����� �������� ������������� a widthp = 18, --����� �������� ���� result[] an = 100, --����������� an ����������� bn = 100 --����������� bn ��������� ); CONSTANT widths= widthp; SUBDESIGN mult_c ( xn[widthx-1..0] : INPUT; yn[widthy-1..0] : INPUT; --sum[widths-1..0] : INPUT; result[widthp-1..0] : OUTPUT; clock : INPUT; clken : INPUT = VCC; aclr : INPUT = GND; ) VARIABLE mult_x : lpm_mult WITH ( LPM_WIDTHA = widthx, LPM_WIDTHB = widthc1, LPM_WIDTHP = widthp, LPM_WIDTHS = widths, INPUT_B_IS_CONSTANT = "YES", LPM_REPRESENTATION = "SIGNED", USE_EAB = "OFF", LPM_PIPELINE = 1, MAXIMIZE_SPEED = 6 ); mult_y : lpm_mult WITH ( LPM_WIDTHA = widthy, LPM_WIDTHB = widthc2, LPM_WIDTHP = widthp, LPM_WIDTHS = widths, INPUT_B_IS_CONSTANT = "YES", LPM_REPRESENTATION = "SIGNED", USE_EAB = "OFF", --LPM_PIPELINE = 1, MAXIMIZE_SPEED = 6 ); BEGIN mult_x.(clock, clken, aclr) = (clock, clken, aclr); mult_x.dataa[] = xn[]; mult_x.datab[] = bn; mult_x.sum[] = mult_y.result[]; result[] = mult_x.result[]; mult_y.dataa[] = yn[]; mult_y.datab[] = an; END; |