




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、9/23/2020 P.1,AHDLTraining Class,Danny Mok Altera HK FAE (),9/23/2020 P.2,What is AHDL,Altera Hardware Description Language develop by Altera integrate into the Altera software Max+Plus II description the hardware in language instead of graphic easy to modify easy to maintane very good for complex c
2、ombinational logic BCD to 7 Segment converter address decoding state machine more than you want.,9/23/2020 P.3,continue.,As easy as Graphic Entry As powerful as HDL (Hardware Description Language) VHDL, Verilog HDL etc.,9/23/2020 P.4,How to use the ADHL,use any text editor to create the file Altera
3、Software Max+Plus II provide text editor,Type in your AHDL design file,9/23/2020 P.5,continue.,Create your AHDL file,9/23/2020 P.6,continue.,save your ADHL file as name.TDF,9/23/2020 P.7,continue.,9/23/2020 P.8,Error Location during Compilation,Easy to locate the error,9/23/2020 P.9,AHDL Template,9/
4、23/2020 P.10,General AHDL Format,SUBDESIGN decode1 ( input_pin_name : INPUT; input_bus_name15.0 : INPUT; output_pin_name : OUTPUT; output_bus_name : OUTPUT; ) BEGIN ouptut_pin_name = input_pin_name; output_bus_name = input_bus_name; END;,Key Word,Defien I/O port,Logic,AHDL format,9/23/2020 P.11,Your
5、 First AHDL design - Address Decoder,Chip_enable = a0 chip_enable : output; ) begin chip_enable = (a3.0 = H7); end;,9/23/2020 P.12,Why I use AHDL instead of Graphic,Easy to Modify Document during the coding I want to decode H”A” not H”7”,SUBDESIGN decode1 ( a3.0 : input; chip_enable : output; ) begi
6、n chip_enable = (a3.0 = HA); end;,Self Explain the Function,Only thing to change,Need more effort to modify,Chip_enable = !a0 chip_enable : output; ) begin chip_enable = (a3.0 = B1x0 x); end;,Some bit can be ignore for comparsion,9/23/2020 P.14,Something you need to know,Addition : + Subtraction : -
7、 Numeric Equality : = Not equal to : != Greater than : Greater than or equal to : = Less than : Less than or equal to : = Logical OR : # Logical AND : SUBDESIGN decode1 ( a3.0 : input; chip_enable : output; ) begin chip_enable = (a3.0 = IO_ADDRESS); if (a3.0 = IO_ADDRESS) then . end;,Define CONSTANT
8、 before SUBDESIGN keyword,9/23/2020 P.16,More about Constant,Constant example Constant IO_ADDRESS = H”370”; Constant FOO = 1+2*3 - LOG2(256); Constant FOO_PLUS_one = FOO + 1;,9/23/2020 P.17,Implement Combinational Logic,out1 = a0 out3.0 : output; ) begin out0 = a0 ,9/23/2020 P.20,More on Bus Operati
9、on,Bus Operation a9.0, b9.0 a = b; a7.4 = b9.6; a9.8 = VCC; a9.8 = 1; a9.8 = 2; a9.8 = 3; a3.0 = GND a3.0 = 0; temp = b0 a2.1 = temp,a7=b9, a6=b8, a5=b7, a4=b6,a9.8 connect to VCC,a9.8 = B”01”,a9.8 = B”10”,a9.8 = B”11”,a3.0 connect to GND,a3.0 = B”0000”,a2 = temp, a1 = temp,9/23/2020 P.21,Advance Bu
10、s Operation,Bus b3.0 b3, b2, b1, b0 (having 4 members) MSB is b3, LSB is b0 ARRAY BUS a3.02.0 a3_2, a3_1, a3_0, a2_2, a2_1, a2_0, a1_2, a1_1, a1_0, a0_2, a0_1, a0_0 (having 12 members) MSB is a3_2, LSB is a0_0,9/23/2020 P.22,Truth Table,i3.0 Segment 7 0 0 1 1 2 2 F F,How easy to make any modificatio
11、n,9/23/2020 P.23,IF-THEN-ELSE,SUBDESIGN priority ( low, medium, high : input; highest_level3.0 : output; ) begin if ( high = B”1”) then highest_level = B”1000”; elsif (medium = B”1”) then highest_level = B”0100”; elsif (low = B”1”) then highest_level = B”0010”; else highest_level = B”0001”; end if;
12、end;,9/23/2020 P.24,Need 4 LCELL,9/23/2020 P.25,CASE Statement,SUBDESIGN decoder (low, medium, high : input; highest_level3.0 : output; ) variable code2.0 : node; begin code2=high; code1=medium; code0=low; case code is when 4 = highest_level = B”1000”; when 2 = highest_level = B”0100”; when 1 = high
13、est_level = B”0010”; when others = highest_level = B”0001”; end case; end;,What is the usage of this statement,9/23/2020 P.26,9/23/2020 P.27,For Loop,CONSTANT num_of_bit = 8; SUBDESIGN numbit ( anum_of_bit.0 : input; bnum_of_bit.0 : output; ) begin b8 = a0; b7 = a1; b6 = a2; b5 = a3; b4 = a4; b3 = a
14、5; b2 = a6; b1 = a7; b0 = a8; end;,9/23/2020 P.28,AHDL with Graphic,Use the File menu to create Symbol for the AHDL design The symbol can be used for graphic entry,9/23/2020 P.29,Register Logic,SUBDESIGN flip_flop ( d, clk : input; q : output;) begin q = dff(d,clk, ,); end;,9/23/2020 P.30,More Detai
15、l,9/23/2020 P.31,More on Register,How to do the Bus with Register How to do the other type of Register DFFE (D-FF with enable) TFF/TFFE JKFF/JKFFE SRFF/SRFFE,9/23/2020 P.32,Register Buses,SUBDESIGN bus_reg ( clk, d7.0 : input; q7.0 : output; ) variable ff7.0 : dff; begin ff.clk = clk; ff.d = d; q =
16、ff.q; end;,9/23/2020 P.33,D-Flip-Flop with Enable/Preset/Clear,SUBDESIGN flip_flop_enable ( clock, data, enable, preset, clear : input; qout : output; ) variable temp : dffe; begin temp.d = data; temp.clk = clock; temp.clrn = clear; temp.prn = preset; temp.ena = enable; qout = temp.q; end;,D,CLK,CLR
17、N,PRN,ENA,Q,9/23/2020 P.34,Other Type of Flip-Flop,9/23/2020 P.35,How to use Help Menu,Q : I dont know how to use Altera DFF/JKFFE, what can I do ? A : Altera Help Menu is a good place to find information Q : How do I use the Help Menu ? A : It is easy and Fun,DFFE,9/23/2020 P.36,How to use Help Men
18、u,9/23/2020 P.37,Tri-state Buffer,SUBDESIGN tri_state (a, enable : input; b : output;) begin b = tri(a, enable); end;,SUBDESIGN tri_state ( a, enable : input; b : output;) variable temp : tri; begin temp.in = a; temp.oe = enable; b = temp.out; end;,9/23/2020 P.38,More Detail,9/23/2020 P.39,OPNDRN -
19、Open Drain Buffer,SUBDESIGN opn_drn (enable : input; b : output;) begin b = opndrn(enable); end;,SUBDESIGN tri_state ( enable : input; b : output;) variable temp : opndrn; begin temp.in= enable; b = temp.out; end;,9/23/2020 P.40,More Detail,9/23/2020 P.41,Using AHDL as EASY as SchematicbutUsing AHDL
20、 is more POWERFUL,9/23/2020 P.42,Exercise,AHDL,input,bidir,clk, enable : input; io : bidir;,9/23/2020 P.43,Design 8 bits Counter is Easy,SUBDESIGN 8bits (clk : input; q7.0 : output; ) variable temp7.0 : dff; begin temp.clk = clk; temp.d = temp.q +1 ; q = temp.q; end;,9/23/2020 P.44,State Machine,SUB
21、DESIGN simple ( clk, reset, jump : input; q : output; ) variable ss : MACHINE WITH STATES (S0,S1); begin ss.clk = clk; ss.reset = reset; case ss is when s0 = q = gnd; if (jump) then ss = s1; end if; when s1 = q = vcc; if (jump) then ss = s0; end if; end case; end;,State Machine Diagram,Note : All St
22、ate Machine Variable must be associated with a CLOCK,jump=1,jump=1,q = 0,q = 1,jump=0,jump=0,9/23/2020 P.45,9/23/2020 P.46,More about State Machine,SUBDESIGN stepper ( reset, ccw, cw, clk : input; phase3.0 : output;) variable ss : MACHINE OF BITS (temp3.0) WITH STATES ( s0 = B”0001”, s1 = B”0010”, s
23、2 = B”0100”, s3 = B”1000”); begin ss.clk = clk; if (reset) then ss = s2; end if; phase = temp;,TABLE ss, ccw, cw = ss; s0, 1, x = s3; s0, x, 1 = s1; s1, 1, x = s0; s1, x, 1 = s2; s2, 1, x = s1; s2, x, 1 = s3; s3, 1, x = s2; s3, x, 1 = s0; END TABLE; end;,Note : No need to declare what is TEMP It is
24、automatic declare as DFF,9/23/2020 P.47,User can control the State Bit,9/23/2020 P.48,Exercise,SUBDESIGN stepper ( reset, ccw, cw, clk : input; phase3.0 : output;) variable ss : MACHINE OF BITS (temp3.0) WITH STATES ( s0 = B”0001”, s1 = B”0010”, s2 = B”0100”, s3 = B”1000”); begin ss.clk = clk; if (r
25、eset) then ss = s2; end if; phase = temp;,TABLE ss, ccw, cw = ss; s0, 1, x = s3; s0, x, 1 = s1; s1, 1, x = s0; s1, x, 1 = s2; s2, 1, x = s1; s2, x, 1 = s3; s3, 1, x = s2; s3, x, 1 = s0; END TABLE; end;,Can you Modify this Truth Table to CASE statement,9/23/2020 P.49,State Machine without Recover Sta
26、te,SUBDESIGN recover ( clk, go : input; ok : output;) variable sequence : MACHINE OF BITS (q2.0) with STATES ( idle, one, two, three, four, illegal1, illegal2, illegal3); begin sequence.clk = clk; case sequence is when idle = if (go) then sequence = one; end if; when one = sequence = two; when two = sequence = three; when three = sequence = four; end case; ok
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 聚焦2025年人工智能在醫(yī)療器械診斷設(shè)備中的智能化升級研究報(bào)告
- 2025年汽車共享平臺智能客服與用戶服務(wù)體驗(yàn)報(bào)告
- 新能源汽車制造2025年智能化生產(chǎn)流程優(yōu)化與成本控制研究報(bào)告
- 新能源汽車充電設(shè)施布局優(yōu)化與可持續(xù)發(fā)展戰(zhàn)略報(bào)告
- 2025年金融租賃公司業(yè)務(wù)創(chuàng)新案例分析:模式創(chuàng)新與風(fēng)險控制策略
- 北京市通州區(qū)市級名校2025年高二化學(xué)第二學(xué)期期末復(fù)習(xí)檢測模擬試題含解析
- 汽車性能與檢測技術(shù)課件
- 電商平臺內(nèi)容營銷與種草經(jīng)濟(jì)融合創(chuàng)新策略研究報(bào)告
- 2025年金融行業(yè)數(shù)據(jù)治理與數(shù)據(jù)資產(chǎn)化在金融機(jī)構(gòu)數(shù)字化轉(zhuǎn)型中的應(yīng)用報(bào)告
- 2025年電商綠色物流行業(yè)綠色物流綠色物流行業(yè)綠色物流政策報(bào)告
- 帶鋼熱軋智能控制系統(tǒng)
- 智能安全帽在智慧工地中的應(yīng)用與管理平臺研究
- Machine-Cmk-設(shè)備能力指數(shù)Cmk分析表
- DB65∕T 3952-2016 反恐怖防范設(shè)置規(guī)范 學(xué)校
- 科研助理合同協(xié)議書
- 離散余弦變換教學(xué)課件
- 術(shù)后鎮(zhèn)痛考試試題及答案
- 《諸子百家教學(xué)課件》課件
- 2025+CSCO胃癌診療指南解讀
- 藥學(xué)三基培訓(xùn)課件
- 2025-2030醫(yī)療美容產(chǎn)業(yè)市場深度調(diào)研及發(fā)展趨勢與投資前景預(yù)測研究報(bào)告
評論
0/150
提交評論