版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Computer Organization and Architecture COURSE DESIGNA Parallel Output Controller- (POC)Southeast universitySchool of Information Science and EngineeringDesign purposeThe purpose of this project is to design and simulate a parallel output controller (POC) which acts an interface between system bus an
2、d printer. The ISE 14.7 EDA tool is recommended and provided for simulation.Learn about the using of Bi-directional Data Bus (BDB), and use a parallel Bi-directional Data Bus to finish the data transmission between CPU and POC.Introduction and TasksPOC is one of the most common I/O modules, namely t
3、he parallel output controller. It plays the role of an interface between the computer system bus and the peripheralFigure 1. System structure diagramAs Fig.1 shows the inner connecting of a printer to the system bus through the POC. The com- munication between POC and the printer is controlled by a
4、“handshake” protocol given in Fig.2.Figure 2. The handshake-timing diagram between POC and the printerThe handshaking process is described as follows: When the printer is ready to receive a char- acter, it holds RDY=1. The POC must then hold a character at PD (parallel data) port and produce a pulse
5、 at the terminal TR (transfer request). The printer will change RDY to 0, take the characterat PD and hold RDY at 0 until the character has been printed (e.g. delay 5 or 10ms), then set RDY to 1 again when it is ready to receive the next character.The buffer register BR is used to temporarily hold a
6、 character sent from the processor, which char- acter will be transferred to the printer later.The status register SR is used for two control functions:SR7 serves as a ready flag to indicate POC is ready or not to receive a new character from the processor.SR0 is used to enable the interrupt request
7、s sent by POC.In interrupt mode, If SR0=1, then POC will send an interrupt request signal to processor when it is ready to receive a character (i.e., when SR7=1).If SR0=0, then POC will not interrupt.The transfer of a character to POC via the system bus proceeds as follows:In interrupt mode, SR0 is
8、always 1.After sending character to printer, POC sets the SR7 to 1, since SR0=1, the interrupt request signal (IRQ) is set to 0, which indicate an effective interrupt signal to the processor.1、processor sets the value of SR7 &sets the value of BRWhen the processor detects the effective IRQ signal, t
9、he processor directly selects BR and writes a character into BR, (processor will never read the state of SR7, which is different with polling mode.)Then the processor sets the SR7 to 0, which indicates that the new character has been written intoBR and not printed yet.2、POC reads and sets the value
10、of SR7& handshakes operations with the printerWhen POC detects that SR7 is set to 0, POC then proceeds to start the handshaking operations with the printer.After sending character to printer, POC sets the SR7 to 1, which indicates POC is ready to receive another character from the processor. The tra
11、nsfer cycle can now repeat.( and are same with the polling state)PS: During the handshaking operations between POC and printer, the processor does not try to access POC until it receives the interrupt request signalThe overall connection of the simulated printer and POC expressed in the top module f
12、ormFigure 3. The top module form of the projectDesign description of the simulation input waveformsThe input and output of CPU,POC and printer are shown below:ProcessorjPinsDescriptionInputclkInput the clock for the CPU running.modeChoose the mode for printing.When mode=1,select a interrupt mode.IRQ
13、Receive the interrupt signal IRQ.When IRQ=1 , new data can be sent.DIN7.0Read data from poc.DOUT7.0Write data into poc.OutputrwShow the direction of the DOUT7.0 and DIN7.0 When rw=0, read data from POC.When rw=1, write data to POC.A0Control the address read and write on POC.When A0=0, choose SR.When
14、 A0=1, choose BR.CSCS=1, poc work.data7.0The data send to POC to be printedPOCPinsDescriptionInputclkInput the clock for the POC running.RWShow the direction of the DOUT7.0 and DIN7.0 When rw=0, send data to CPU.When rw=1, read data from CPU.A0Input address,When A0=0, choose BR. When A0=1, choose SR
15、.RDYInput the ready signal from printer. When RDY=1, the printer is idle.When RDY=0, the printer is busy.CSInput the mode of the POC.When CS=0,select a polling mode. When CS=1,select a interrupt mode.data7.0The data receive from CPU to be printed.OutputPD7.0Output the data to printer.IRQOutput the i
16、nterrupt signal IRQ to CPU,showing the POC and printer is ready.TRThe response to print RDY signal, a one-cycle pulse at the port TR(transfer request) shows that new data is sent to printer.DOUT7.0CS=0POC send the state of SR to CPU ;CS=1CPU read the data write in BRSignalSR7.0The register contains
17、the flags for the POC. When SR(7)=1, its idle.When SR(7)=0, its busy.BR7.0The register holds the value of data to print.printerPinsDescriptionInputclkInput the clock for the printer running.TRInput the pulse signal from POC, to show new data is coming.PD7.0Input the data from POC.OutputRDYOutput RDY
18、 signal,when RDY=1, it shows printer is waiting for new data.Simulation resultsConnection between cpu and pocConnection between poc and printerHere are the explanations of the simulation wave:interrupt mode:1、In the interrupt mode,mode is always set 1, the print process occures by the IRQ signal fro
19、m poc.2、When S(7)=0, IRA send 0 to cpu, it means there is a print requirement and cpu begin to handle it. 3、 In the interrupt process RW and A0 are singals from cpu to poc to control the action of poc.RW=1 and A0=1 write data from cpu(D) to poc(BR), means the begin of the interrupt process.RW=x and
20、A0=x means there is no interrupt requirement .4、After sending datas to BR and set sr to “00000000”, if RDY=1, poc give a impulse in TR to make the printer begin to work. After the TR signal we can see that the input RDY signal from the printer change from 1 to 0, which shows that the TR signal reall
21、y make the printer work. 5、After data of BR has been transmitted into printer, poc set SR to “10000001” itself to indicate that it comes to ready and can get the next print task.6、Let data plus 1 to indicate the next new print cycle.6. Conclusion and Discussions1、As a parallel output controller ,poc
22、 module to act as an interface between cpu and printer. Form the simulation wave, we can see that my program meets the designs requirements.2、I divide the system into three parts, and one top entity. And I use two way to finishthe top entity. One is write program with vhdl language and another is cr
23、eate aschematic type file and connect wire.3、By designing the POC module, I find it helps to learn how to use of quartus and VHDL for design and simulation.The process of designing also teachs me the importantce of figuring out the struc- ture and timing of the task before programming .Appendix:The
24、program of processor:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;- Uncomment the following library declaration if using- arithmetic functions with Signed or Unsigned values-use IEEE.NUMERIC_STD.ALL;- Uncomment the following library declaratio
25、n if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity processor isport(clk : in std_logic;IRQ : in std_logic;DOUT : out std_logic_vector(7 downto 0):=00000000;RW : out std_logic:=0;-0read,1writeA0 : out std_logic:=0;-0sr,1brDIN : in std_logic_vecto
26、r(7 downto 0);end processor;architecture Behavioral of processor issignal data:std_logic_vector(7 downto 0):=00000000;signal mode:std_logic:=1;-默覺(jué)得中斷模式beginprocess(clk)begin if clkevent and clk=1 thenif mode=1 then if IRQ=0 then A0=1; RW=1;-寫(xiě)入數(shù)據(jù)到BR data=data+00000001;-代表傳播旳字符 DOUT=data; else A0=X; R
27、W=X;-讀入SR旳數(shù)據(jù) end if; end if;end if;end process;end Behavioral;the program of poc:library IEEE;use IEEE.STD_LOGIC_1164.ALL;use ieee.std_logic_arith.ALL;use ieee.std_logic_unsigned.ALL;- Uncomment the following library declaration if using- arithmetic functions with Signed or Unsigned values-use IEEE.
28、NUMERIC_STD.ALL;- Uncomment the following library declaration if instantiating- any Xilinx primitives in this code.-library UNISIM;-use UNISIM.VComponents.all;entity poc isport(A0 : in std_logic;RW : in std_logic;clk : in std_logic;CS : in std_logic:=1;RDY : in std_logic;IRQ : out std_logic:=1;DOUT
29、: out std_logic_vector(7 downto 0);PD : out std_logic_vector(7 downto 0);TR : out std_logic:=0;DIN : in std_logic_vector(7 downto 0);end poc;architecture Behavioral of poc issignal SR : std_logic_vector(7 downto 0):=10000001;signal BR : std_logic_vector(7 downto 0):=00000000;signal count:integer ran
30、ge 0 to 5:=0;type state_type is (s0,s1,s2);signal state: state_type:=s0;beginprocess(clk)begin if clkevent and clk=1 then TR=0; IRQ-中斷祈求信號(hào) if SR(7)=1 then IRQ=0;-中斷祈求state=s1; else IRQ=1;state-讀入讀出選擇 if RW=1 and A0=1 then-cpu寫(xiě)入數(shù)據(jù)到BR BR=DIN; SR(7)=0;state=s2; elsif RW=0 and A0=0 then-cpu讀入SR旳數(shù)據(jù) DOUT=SR; elsif RW=1 and A0=0 then-cpu寫(xiě)入數(shù)據(jù)到SR SR=DIN; elsif RW=0 and A0=1 then-cpu讀入BR旳數(shù)據(jù) DOUT-打印機(jī) if RDY=1 then TR=1; PD=BR; SR(7)=1; end if;state=s0; end case;end if;end process;end Behavi
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 遼陽(yáng)職業(yè)技術(shù)學(xué)院《化工CAD制圖》2023-2024學(xué)年第一學(xué)期期末試卷
- 五年級(jí)數(shù)學(xué)下冊(cè)應(yīng)用題-分?jǐn)?shù)應(yīng)用題
- 廊坊燕京職業(yè)技術(shù)學(xué)院《信息系統(tǒng)審計(jì)》2023-2024學(xué)年第一學(xué)期期末試卷
- 江西師范高等??茖W(xué)?!缎旅襟w網(wǎng)絡(luò)營(yíng)銷(xiāo)劃寫(xiě)作》2023-2024學(xué)年第一學(xué)期期末試卷
- 嘉應(yīng)學(xué)院《奧爾夫音樂(lè)教學(xué)法》2023-2024學(xué)年第一學(xué)期期末試卷
- 湖州學(xué)院《傳感器技術(shù)與應(yīng)用》2023-2024學(xué)年第一學(xué)期期末試卷
- 湖南國(guó)防工業(yè)職業(yè)技術(shù)學(xué)院《電子學(xué)二》2023-2024學(xué)年第一學(xué)期期末試卷
- 紅河衛(wèi)生職業(yè)學(xué)院《傳播學(xué)原理與技能》2023-2024學(xué)年第一學(xué)期期末試卷
- 淄博師范高等??茖W(xué)?!冬F(xiàn)代數(shù)值仿真技術(shù)》2023-2024學(xué)年第一學(xué)期期末試卷
- 周口理工職業(yè)學(xué)院《熱工材料基礎(chǔ)》2023-2024學(xué)年第一學(xué)期期末試卷
- 保險(xiǎn)公估作業(yè)指導(dǎo)書(shū)x
- 新人教版八年級(jí)數(shù)學(xué)下冊(cè) 第18章平行四邊形 導(dǎo)學(xué)案
- 《生理心理學(xué)實(shí)驗(yàn)實(shí)訓(xùn)》指導(dǎo)書(shū)-
- 教練技術(shù)三階段講義
- GB/T 23799-2021車(chē)用甲醇汽油(M85)
- 車(chē)工工藝課件(緒論、一章)
- 催收服務(wù)工作手冊(cè)方案
- 信息化系統(tǒng)數(shù)據(jù)恢復(fù)應(yīng)急演練方案
- 常用有機(jī)溶劑性質(zhì)
- 公司沒(méi)有出審計(jì)報(bào)告情況說(shuō)明解釋
- (完整word版)高考英語(yǔ)作文練習(xí)紙(標(biāo)準(zhǔn)答題卡)
評(píng)論
0/150
提交評(píng)論