版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、 用quartus II 軟件設計4位乘法器1. 并行乘法的算法: 下面根據(jù)乘法例題來分析這種算法,題中M4,M3,M2,M1是被乘數(shù),用M表示。N4,N3,N2,N1是乘數(shù),用N表示2.乘法模塊Library ieee; Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity and4a isPort(a:in std_logic_vector(3 downto 0); en:in std_logic; r:out std_logic_vector(3 downto 0);End and4a;Architectur
2、e behave of and4a isBegin Process(en,a(3 downto 0) Begin If (en=1) then r=a; Else r=0000; End if;End process;End behave;3. 加法模塊Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity ls283 isPort (o1,o2:in std_logic_vector(3 downto 0); res:out std_logic_vector(4 downto 0);End
3、 ls283;Architecture behave of ls283 isBegin Process(o1,o2) Begin res=(0&o1)+(0&o2); End process;End behave;4. 主程序Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_unsigned.all;Entity mul4p isPort (op1,op2:in std_logic_vector(3 downto 0); result:out std_logic_vector(7 downto 0);End mul4p;Ar
4、chitecture count of mul4p is component and4a port (a:in std_logic_vector(3 downto 0); en:in std_logic; r:out std_logic_vector(3 downto 0);End component;Component ls283 port (o1,o2:in std_logic_vector(3 downto 0); res:out std_logic_vector(4 downto 0);End component;Signal sa:std_logic_vector(3 downto
5、0);Signal sb:std_logic_vector(4 downto 0);Signal sc:std_logic_vector(3 downto 0);Signal sd:std_logic_vector(4 downto 0);Signal se:std_logic_vector(3 downto 0);Signal sf:std_logic_vector(3 downto 0);Signal sg:std_logic_vector(3 downto 0);-signal tmp1:std_logic;Begin sg=(0&sf (3 downto 1); -tmp1op2,en
6、=op1(1),r=se); U1:and4a port map(a=op2,en=op1(3),r=sa); U2:ls283 port map(o1=sb(4 downto 1),o2=sa,res=result(7 downto 3); U3:and4a port map(a=op2,en=op1(2),r=sc); U4:ls283 port map(o1=sc,o2=sd(4 downto 1),res=sb); u5:ls283 port map(o1=sg,o2=se,res=sd); u6:and4a port map(a=op2,en=op1(0),r=sf); result(0)=sf(0); result(1)=sd(0); result(2)=sb(0); -result(7 downto 0)=;End count;5.仿真波形圖6.引腳分配圖7. 硬件下載編程與硬件實
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 電廠安全危險課件
- 未來五年地鐵站保潔服務企業(yè)數(shù)字化轉(zhuǎn)型與智慧升級戰(zhàn)略分析研究報告
- 電廠夏季安全培訓資料課件
- 未來五年購物中心餐飲店企業(yè)數(shù)字化轉(zhuǎn)型與智慧升級戰(zhàn)略分析研究報告
- 未來五年非金屬礦物質(zhì)廢棄物治理服務企業(yè)ESG實踐與創(chuàng)新戰(zhàn)略分析研究報告
- 鐵路安全培訓技巧課件
- 湖北線上紅娘培訓課件
- 光伏運維人員制度規(guī)范要求
- 紡織設備巡檢制度規(guī)范標準
- 公園保潔制度與管理制度規(guī)范
- 個人投資收款收據(jù)
- 太陽能路燈可行性研究報告
- 華為在歐洲市場分析報告
- 中國工藝美術館招聘筆試試卷2021
- 申論范文寶典
- DB32T 3695-2019房屋面積測算技術規(guī)程
- 貴州省納雍縣水東鄉(xiāng)水東鉬鎳礦采礦權評估報告
- GB 8270-2014食品安全國家標準食品添加劑甜菊糖苷
- 易制毒化學品日常管理有關問題權威解釋和答疑
- 湖北省高等教育自學考試
- 企業(yè)三級安全生產(chǎn)標準化評定表(新版)
評論
0/150
提交評論