




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、電子設(shè)計自動化多路波形發(fā)生器指導(dǎo)老師:劉彪電氣工程學(xué)院電氣1003班楊黎102910942021年10月27日一、 實(shí)驗(yàn)題目要求 1、對輸入時鐘信號進(jìn)行分頻,實(shí)現(xiàn)三路互差120° 的信號。2、實(shí)現(xiàn)輸出信號的占空比控制 clk: 輸入時鐘信號 reset: 同步復(fù)位信號低電平有效 div: 輸入分頻控制信號(注意:6n分頻) ctrl: 占空比控制信號 ctrl=1時, 占空比為1:1 ctrl=2時, 占空比為1:2 ctrl=3時, 占空比為2:1 A,B,C: 三路輸出信號二、 設(shè)計思路及方案1、多路發(fā)生器的根本原理分頻器而且是可調(diào)的。因此可以先設(shè)計多個子程序分別使得信號發(fā)生器的
2、產(chǎn)生的占空比分別為1:1,1:2,2:1;因此先設(shè)div:integer range 1 to 4;。通過信號賦值tmp,tmp1,tmp2賦給輸出信號A,B,C. 通過n改變輸出頻率。定義各個變量。2、當(dāng)resetb=0時,countQ=0;當(dāng)resetb=1時。給脈沖時先定義分頻比方果countQ < (6*div-1)時countQ <= countQ 否那么countQ為0。3、當(dāng)cltr=01時即H:L=1:1時如果countQ < 3*div時tmp<=0;否者tmp<=1如果countQ < 2*div or countQ>(6*div-
3、2)時tmp1<= '1'否者 tmp1<='0'如果countQ < div or countQ>(4*div-1)時tmp2<= '0'否者 tmp2<='1'A等于tmp;B=tmp2;C=tmp3;同理:當(dāng)cltr=10時即H:L=1:2時 當(dāng)cltr=11時即H:L=2:1時。其中;公式推導(dǎo)如下:當(dāng)div=1,cltr=01時 當(dāng)div=2,cltr=01時 countQ<6 countQ<12A:0 0 0 1 1 1; A:0 0 0 0 0 0 1 1 1 1 1 1
4、B:1 1 0 0 0 1; B:1 1 1 1 0 0 0 0 0 0 1 1C:0 1 1 1 0 0; C:0 0 1 1 1 1 1 1 0 0 0 0A:countQ<3時tmp=0 A;countQ<6時tmp=0Else tmp=1 Else tmp=1B:countQ<2 or countQ>4時tmp=1 B:countQ<4or countQ>10 ,tmp=1 Else tmp=0 Else tmp=0C:countQ<1 or countQ>3時tmp=0 C: countQ<2 or countQ>7時tmp
5、=0Else tmp=1 Else tmp=1同理:cltr=10,cltr=11.當(dāng)cltr=01時if(countQ < 3*div) then tmp<= '0'else tmp<='1'if(countQ < 2*div or countQ>(6*div-2) then tmp1<= '1'else tmp1<='0'if(countQ < div or countQ>(4*div-1) then tmp2<= '0'else tmp2<=&
6、#39;1'當(dāng)cltr=10時if(countQ < 4*div) then tmp<= '0'else tmp<='1'if(countQ < 2*div ) then tmp1<= '1'else tmp1<='0'if(countQ < 2*div or countQ>(4*div-1) then tmp2<= '0' else tmp2<='1'當(dāng)cltr=11時if(countQ < 2*div) then tmp&
7、lt;= '0'else tmp<='1'if(countQ < 2*div or countQ>(4*div-1) then tmp1<= '1'else tmp1<='0'if(countQ < 4*div ) then tmp2<= '1'else tmp2<='0'將信號tmp 賦給A ; tmp1 賦給B ; tmp2 賦給 C ;三、流程圖Reset=0? 0 1Tmp、tmp1、tmp2=0是否有信號輸入Tmp=a tmp1=b tmp2
8、=c判定ctrl的值 否 是 1 2 3調(diào)用相應(yīng)的子程序 四、實(shí)驗(yàn)程序及其波形 library ieee;use ieee.std_logic_1164.all;use ;use ;entity fashengq is port ( clk:in std_logic; aclk:out std_logic; bclk:out std_logic; cclk:out std_logic; resetb:in std_logic; div:in std_logic_vector(1 downto 0); ctrl:in std_logic_vector(1 downto 0) );end fang
9、shengq;architecture behave of fangshengq issignal tmp:std_logic; signal tmp1:std_logic; signal tmp2:std_logic; signal cnt0:integer range 0 to 5:=0; signal cnt1:integer range 0 to 11:=0; signal cnt2:integer range 0 to 17:=0; signal cnt3:integer range 0 to 23:=0; begin process(clk,resetb,div,ctrl) beg
10、in if clk'event and clk='1' then if resetb='0' then cnt0<=0; cnt1<=0; cnt2<=0; cnt3<=0; tmp<='0' tmp1<='0' tmp2<='0' elsif resetb='1' then cnt0<=cnt0+1; cnt1<=cnt1+1; cnt2<=cnt2+1; cnt3<=cnt3+1; case ctrl is when &q
11、uot;01"=> case div is when "00"=> case cnt0 is when 0=>tmp<='0'tmp1<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='1' when 2=>tmp<='0'tmp1<='0'tmp2<='1' when 3=>tmp<=
12、'1'tmp1<='0'tmp2<='1' when 4=>tmp<='1'tmp1<='0'tmp2<='0' when 5=>tmp<='1'tmp1<='1'tmp2<='0'cnt0<=0; end case; when "01"=> case cnt1 is when 0=>tmp<='0'tmp1<='1
13、39;tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='0' when 2=>tmp<='0'tmp1<='1'tmp2<='1' when 3=>tmp<='0'tmp1<='1'tmp2<='1' when 4=>tmp<='0'tmp1<='0'tmp2<='
14、;1' when 5=>tmp<='0'tmp1<='0'tmp2<='1' when 6=>tmp<='1'tmp1<='0'tmp2<='1' when 7=>tmp<='1'tmp1<='0'tmp2<='1' when 8=>tmp<='1'tmp1<='0'tmp2<='0' when 9=&
15、gt;tmp<='1'tmp1<='0'tmp2<='0' when 10=>tmp<='1'tmp1<='1'tmp2<='0' when 11=>tmp<='1'tmp1<='1'tmp2<='0'cnt1<=0; end case; when "10"=> case cnt2 is when 0=>tmp<='0'tmp1
16、<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='0' when 2=>tmp<='0'tmp1<='1'tmp2<='0' when 3=>tmp<='0'tmp1<='1'tmp2<='1' when 4=>tmp<='0'tmp1<='1'
17、tmp2<='1' when 5=>tmp<='0'tmp1<='1'tmp2<='1' when 6=>tmp<='0'tmp1<='0'tmp2<='1' when 7=>tmp<='0'tmp1<='0'tmp2<='1' when 8=>tmp<='0'tmp1<='0'tmp2<='1&
18、#39; when 9=>tmp<='1'tmp1<='0'tmp2<='1' when 10=>tmp<='1'tmp1<='0'tmp2<='1' when 11=>tmp<='1'tmp1<='0'tmp2<='1' when 12=>tmp<='1'tmp1<='0'tmp2<='0' when 13=
19、>tmp<='1'tmp1<='0'tmp2<='0' when 14=>tmp<='1'tmp1<='0'tmp2<='0' when 15=>tmp<='1'tmp1<='1'tmp2<='0' when 16=>tmp<='1'tmp1<='1'tmp2<='0' when 17=>tmp<=
20、'1'tmp1<='1'tmp2<='0'cnt2<=0; end case; when "11"=> case cnt3 is when 0=>tmp<='0'tmp1<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='0' when 2=>tmp<='0'tmp1<='1
21、39;tmp2<='0' when 3=>tmp<='0'tmp1<='1'tmp2<='0' when 4=>tmp<='0'tmp1<='1'tmp2<='1' when 5=>tmp<='0'tmp1<='1'tmp2<='1' when 6=>tmp<='0'tmp1<='1'tmp2<='
22、;1' when 7=>tmp<='0'tmp1<='1'tmp2<='1' when 8=>tmp<='0'tmp1<='0'tmp2<='1' when 9=>tmp<='0'tmp1<='0'tmp2<='1' when 10=>tmp<='0'tmp1<='0'tmp2<='1' when 11
23、=>tmp<='0'tmp1<='0'tmp2<='1' when 12=>tmp<='1'tmp1<='0'tmp2<='1' when 13=>tmp<='1'tmp1<='0'tmp2<='1' when 14=>tmp<='1'tmp1<='0'tmp2<='1' when 15=>tmp<
24、='1'tmp1<='0'tmp2<='1' when 16=>tmp<='1'tmp1<='0'tmp2<='0' when 17=>tmp<='1'tmp1<='0'tmp2<='0' when 18=>tmp<='1'tmp1<='0'tmp2<='0' when 19=>tmp<='1'
25、tmp1<='0'tmp2<='0' when 20=>tmp<='1'tmp1<='1'tmp2<='0' when 21=>tmp<='1'tmp1<='1'tmp2<='0' when 22=>tmp<='1'tmp1<='1'tmp2<='0' when 23=>tmp<='1'tmp1<=
26、9;1'tmp2<='0'cnt3<=0; end case; end case; when "10"=> case div is when "00"=> case cnt0 is when 0=>tmp<='0'tmp1<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='0' when 2=>tmp<='
27、;0'tmp1<='0'tmp2<='1' when 3=>tmp<='0'tmp1<='0'tmp2<='1' when 4=>tmp<='1'tmp1<='0'tmp2<='0' when 5=>tmp<='1'tmp1<='0'tmp2<='0'cnt0<=0; end case; when "01"
28、;=> case cnt1 is when 0=>tmp<='0'tmp1<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='0' when 2=>tmp<='0'tmp1<='1'tmp2<='0' when 3=>tmp<='0'tmp1<='1'tmp2<='0
29、39; when 4=>tmp<='0'tmp1<='0'tmp2<='1' when 5=>tmp<='0'tmp1<='0'tmp2<='1' when 6=>tmp<='0'tmp1<='0'tmp2<='1' when 7=>tmp<='0'tmp1<='0'tmp2<='1' when 8=>t
30、mp<='1'tmp1<='0'tmp2<='0' when 9=>tmp<='1'tmp1<='0'tmp2<='0' when 10=>tmp<='1'tmp1<='0'tmp2<='0' when 11=>tmp<='1'tmp1<='0'tmp2<='0'cnt1<=0; end case; when
31、"10"=> case cnt2 is when 0=>tmp<='0'tmp1<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1'tmp2<='0' when 2=>tmp<='0'tmp1<='1'tmp2<='0' when 3=>tmp<='0'tmp1<='1'tmp2
32、<='0' when 4=>tmp<='0'tmp1<='1'tmp2<='0' when 5=>tmp<='0'tmp1<='1'tmp2<='0' when 6=>tmp<='0'tmp1<='0'tmp2<='1' when 7=>tmp<='0'tmp1<='0'tmp2<='1'
33、 when 8=>tmp<='0'tmp1<='0'tmp2<='1' when 9=>tmp<='0'tmp1<='0'tmp2<='1' when 10=>tmp<='0'tmp1<='0'tmp2<='1' when 11=>tmp<='0'tmp1<='0'tmp2<='1' when 12=>t
34、mp<='1'tmp1<='0'tmp2<='0' when 13=>tmp<='1'tmp1<='0'tmp2<='0' when 14=>tmp<='1'tmp1<='0'tmp2<='0' when 15=>tmp<='1'tmp1<='0'tmp2<='0' when 16=>tmp<='
35、1'tmp1<='0'tmp2<='0' when 17=>tmp<='1'tmp1<='0'tmp2<='0'cnt2<=0; end case; when "11"=> case cnt3 is when 0=>tmp<='0'tmp1<='1'tmp2<='0' when 1=>tmp<='0'tmp1<='1't
36、mp2<='0' when 2=>tmp<='0'tmp1<='1'tmp2<='0' when 3=>tmp<='0'tmp1<='1'tmp2<='0' when 4=>tmp<='0'tmp1<='1'tmp2<='0' when 5=>tmp<='0'tmp1<='1'tmp2<='0
37、39; when 6=>tmp<='0'tmp1<='1'tmp2<='0' when 7=>tmp<='0'tmp1<='1'tmp2<='0' when 8=>tmp<='0'tmp1<='0'tmp2<='1' when 9=>tmp<='0'tmp1<='0'tmp2<='1' when 10=>
38、tmp<='0'tmp1<='0'tmp2<='1' when 11=>tmp<='0'tmp1<='0'tmp2<='1' when 12=>tmp<='0'tmp1<='0'tmp2<='1' when 13=>tmp<='0'tmp1<='0'tmp2<='1' when 14=>tmp<='
39、;0'tmp1<='0'tmp2<='1' when 15=>tmp<='0'tmp1<='0'tmp2<='1' when 16=>tmp<='1'tmp1<='0'tmp2<='0' when 17=>tmp<='1'tmp1<='0'tmp2<='0' when 18=>tmp<='1'tmp1&
40、lt;='0'tmp2<='0' when 19=>tmp<='1'tmp1<='0'tmp2<='0' when 20=>tmp<='1'tmp1<='0'tmp2<='0' when 21=>tmp<='1'tmp1<='0'tmp2<='0' when 22=>tmp<='1'tmp1<='0
41、39;tmp2<='0' when 23=>tmp<='1'tmp1<='0'tmp2<='0'cnt3<=0; end case; end case; when "11"=> case div is when "00"=> case cnt0 is when 0=>tmp<='0'tmp1<='1'tmp2<='1' when 1=>tmp<='0
42、39;tmp1<='1'tmp2<='1' when 2=>tmp<='1'tmp1<='0'tmp2<='1' when 3=>tmp<='1'tmp1<='0'tmp2<='1' when 4=>tmp<='1'tmp1<='1'tmp2<='0' when 5=>tmp<='1'tmp1<='
43、;1'tmp2<='0'cnt0<=0; end case; when "01"=> case cnt1 is when 0=>tmp<='0'tmp1<='1'tmp2<='1' when 1=>tmp<='0'tmp1<='1'tmp2<='1' when 2=>tmp<='0'tmp1<='1'tmp2<='1'
44、when 3=>tmp<='0'tmp1<='1'tmp2<='1' when 4=>tmp<='1'tmp1<='0'tmp2<='1' when 5=>tmp<='1'tmp1<='0'tmp2<='1' when 6=>tmp<='1'tmp1<='0'tmp2<='1' when 7=>tmp&l
45、t;='1'tmp1<='0'tmp2<='1' when 8=>tmp<='1'tmp1<='1'tmp2<='0' when 9=>tmp<='1'tmp1<='1'tmp2<='0' when 10=>tmp<='1'tmp1<='1'tmp2<='0' when 11=>tmp<='1'
46、tmp1<='1'tmp2<='0'cnt1<=0; end case; when "10"=> case cnt2 is when 0=>tmp<='0'tmp1<='1'tmp2<='1' when 1=>tmp<='0'tmp1<='1'tmp2<='1' when 2=>tmp<='0'tmp1<='1'tmp2<
47、='1' when 3=>tmp<='0'tmp1<='1'tmp2<='1' when 4=>tmp<='0'tmp1<='1'tmp2<='1' when 5=>tmp<='0'tmp1<='1'tmp2<='1' when 6=>tmp<='1'tmp1<='0'tmp2<='1' whe
48、n 7=>tmp<='1'tmp1<='0'tmp2<='1' when 8=>tmp<='1'tmp1<='0'tmp2<='1' when 9=>tmp<='1'tmp1<='0'tmp2<='1' when 10=>tmp<='1'tmp1<='0'tmp2<='1' when 11=>tmp<
49、;='1'tmp1<='0'tmp2<='1' when 12=>tmp<='1'tmp1<='1'tmp2<='0' when 13=>tmp<='1'tmp1<='1'tmp2<='0' when 14=>tmp<='1'tmp1<='1'tmp2<='0' when 15=>tmp<='1'
50、;tmp1<='1'tmp2<='0' when 16=>tmp<='1'tmp1<='1'tmp2<='0' when 17=>tmp<='1'tmp1<='1'tmp2<='0'cnt2<=0; end case; when "11"=> case cnt3 is when 0=>tmp<='0'tmp1<='1'tmp2&
51、lt;='1' when 1=>tmp<='0'tmp1<='1'tmp2<='1' when 2=>tmp<='0'tmp1<='1'tmp2<='1' when 3=>tmp<='0'tmp1<='1'tmp2<='1' when 4=>tmp<='0'tmp1<='1'tmp2<='1' when 5=>tmp<='0'tmp1<='1'tmp2<='1' when 6=>tmp<='0'tmp1<='1'tmp2<='1' when 7=>tmp<='0'tmp1<='1'tmp2<='1' when 8=>tmp<='1'tmp1<='0'tmp2&
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 安徽省阜陽市潁上縣第二中學(xué)2025屆化學(xué)高一下期末教學(xué)質(zhì)量檢測模擬試題含解析
- 江西省永豐中學(xué)2025年高一下化學(xué)期末達(dá)標(biāo)檢測試題含解析
- 河北省深州市中學(xué)2025屆高二化學(xué)第二學(xué)期期末質(zhì)量跟蹤監(jiān)視模擬試題含解析
- 條形碼管理辦法規(guī)定為
- 農(nóng)家書屋維護(hù)管理辦法
- 材料外放加工管理辦法
- 晉安白蟻防治管理辦法
- 華為電子發(fā)票管理辦法
- 機(jī)電運(yùn)輸三違管理辦法
- 教師業(yè)務(wù)專長案例分析
- 河北省2025年中考數(shù)學(xué)真題試卷(含答案)
- 福建福州金山中學(xué)2024~2025學(xué)年高一下冊期末考試數(shù)學(xué)試題含解析
- 2025年廣東省高考生物真題(解析版)
- 2024年哈爾濱市道里區(qū)執(zhí)法輔助人員招聘考試真題
- 學(xué)堂在線 研究生的壓力應(yīng)對與健康心理 期末考試答案
- 2025年7月自考13811績效管理試題及答案含解析
- 企業(yè)環(huán)境監(jiān)測管理制度
- 試藥員知情協(xié)議書
- 2025年嘉興市恒光電力建設(shè)有限責(zé)任公司招聘筆試參考題庫附帶答案詳解
- 2025內(nèi)蒙古鄂爾多斯農(nóng)商行烏海各機(jī)構(gòu)員工社會招聘37人筆試歷年典型考題及考點(diǎn)剖析附帶答案詳解
- XX林場20XX年度森林質(zhì)量精準(zhǔn)提升項(xiàng)目實(shí)施方案(范文)
評論
0/150
提交評論