Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 58|回复: 0

计算机的制作(六)-基于Z80处理器制作微型计算机

[复制链接]

1万

主题

1万

帖子

5万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
58026
发表于 2020-10-20 11:41:16 | 显示全部楼层 |阅读模式

                    

                    

                    
                    
                    <p><span style="font-size: 20px;"><strong><img class="" data-ratio="0.42710120068610635" src="http://mmbiz.qpic.cn/mmbiz_jpg/LKgI6UN8ElafygecA4sIudtYiaWboKoIWIwFaec2qHuNFznNFwxJsFcgelgficzvZibFnwWZcVict9QGBiasmaPbVDQ/640?wx_fmt=jpeg" data-type="jpeg" data-w="583"  /></strong></span></p><p><strong><span style="font-size: 20px;"><strong style="white-space: normal;">本节类容的基础请参考</strong><strong style="color: rgb(255, 76, 0);text-decoration: underline;white-space: normal;">计算机的制作(五)-全自动加法计算机</strong></span></strong></p><p><strong><span style="font-size: 20px;"><br  /></span></strong></p><p><strong><span style="font-size: 20px;">一、计算机的三个根本性基础</span></strong></p><p>1.计算机是执行输入、运算、输出的机器</p><p>2.程序是指令和数据的集合</p><p>3.计算机的处理方式有时与人的思维习惯不同,对它来说什么都是数字0或1</p><p><strong>应用:</strong></p><p><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;理解了上面的三大原则,即使遇到难懂的最新技术,也能轻松应对。</span></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下面是具体的例子。</p><p><strong><span style="font-size: 20px;"><img class="" data-ratio="1.2518518518518518" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWYYwjTibbFwiaUhUibkD8QM9qlPBEv1dlRbT3t2C7icka29M1HLCmUAN0eg/640?wx_fmt=png" data-type="png" data-w="540" style="white-space: normal;"  /></span></strong></p><p><strong><span style="font-size: 20px;"><br  /></span></strong></p><p><strong><span style="font-size: 20px;">二、制作微型计算机所需的元件</span></strong></p><p><strong>1. 计算机硬件的组成框图</strong></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;只要用用电路把CPU、内存以及I/O上的引脚相互连接起来,为每块IC提供电源, 再为CPU提供时钟信号,奔腾CPU时钟信号频率从几百MHz到2GHz甚至更高。硬件上的计算机就组装起来了,如下图所示。<img class="" data-ratio="0.5485714285714286" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIW8htN2amPI7MliaEZrfgZ56z10poVzSkyKfjibvJzWJVgFwIuyqlGEolA/640?wx_fmt=png" data-type="png" data-w="525"  /></p><p><br  /></p><p><strong>2.制作微型计算机所需的基础元件只有3个:</strong>CPU、内存、I/O</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CPU:是计算机的大脑,负责解释、执行程序;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;内存:负责存储程序和数据;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I/O:负责将计算机和外部设备连接在一起。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这里我们使用Z80 CPU作为微型计算机的CPU、TC5517作为内存、Z80 PIO作为I/O。下表就是需要用到的元器件参数:&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</p><p><img class="" data-ratio="1.3774250440917108" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWqjfngkyKWibobiaXPXB511F4NkTdDicsSYWMJ3by3kAOyhC0eCz0d4CJQ/640?wx_fmt=png" data-type="png" data-w="567"  /></p><p><strong><br  /></strong></p><p><strong>3.上述元器件各引脚说明</strong><img class="" data-ratio="0.8674911660777385" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIW7k3h7Jb12KZHc3a1ibcp6pnTS5rYOyX6LjIGjtG36PsWhKfczs2FRdQ/640?wx_fmt=png" data-type="png" data-w="566"  /><img class="" data-ratio="1.2985865724381624" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIW7nlAtt6AulMa4fWAIQWckVtu0fPUDXnSwTS1uMm2qG86kJmhAxzPEg/640?wx_fmt=png" data-type="png" data-w="566"  /></p><p><strong style="font-size: 20px;"><br  /></strong></p><p><strong>4.各元器件连接电路图</strong></p><p style="white-space: normal;">计算机以CPU为中心运转,CPU可以与内存或I/O进行数据的输入输出。<br  /></p><p style="white-space: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;为了指定输入输出数据时的源头或目的地,CPU上备有“地址总线引脚”。<br  /></p><p style="white-space: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<strong><span style="color: rgb(255, 76, 0);">①</span></strong><span style="color: rgb(255, 76, 0);">&nbsp;</span><span style="color: rgb(0, 209, 0);">Z80 CPU地址总线引脚有16个,用A0~A15表示,A表示Address。<br  /></span></p><p style="white-space: normal;"><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;16个地址总线引脚所能指定的地址共有2^16次方个,即65536个地址,用二进制表示为:0000000000000000~1111111111111111。<br  /></span></p><p style="white-space: normal;"><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因此,Z80 CPU可以指定65536个数据存取单元。</span><br  /></p><p style="white-space: normal;"><span style="color: rgb(0, 209, 0);">&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: rgb(255, 76, 0);"> <strong>②</strong></span><span style="color: rgb(120, 172, 254);">Z80 CPU的数据总线引脚共有8个,用D0~D7表示,D表示Data。</span></p><p style="white-space: normal;"><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8个数据总线引脚表示一个8位二进制数各位数字的位置。<br  /></span></p><p style="white-space: normal;"><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因此,Z80 CPU一次性可以输入输出8比特的数据。<br  /></span></p><p style="white-space: normal;"><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果数据大于8比特就要以8比特为单位切分这个数据。</span></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><span style="color: rgb(255, 76, 0);"><strong>③</strong></span><span style="color: rgb(0, 209, 0);"><strong>内存TC5517上也有地址总线引脚(A0~A10)和数据总线引脚(D0~D7)。</strong></span><br  /></p><p><span style="color: rgb(0, 209, 0);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TC5517所指定的地址共有2^11次方个,即2048个地址。每个地址存储1个8比特数据。<br  /></strong></span></p><p><span style="color: rgb(0, 209, 0);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></span><span style="color: rgb(255, 76, 0);"><strong>④</strong></span><span style="color: rgb(120, 172, 254);"><strong>Z80 PIO共有4个寄存器,两个用于设定PIO本身的功能,两个用于存储与外部设备进行输入输出的数据。</strong></span></p><p><span style="color: rgb(120, 172, 254);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这4个寄存器分别叫做端口A控制、端口A数据、端口B控制和端口B数据。</strong></span></p><p><span style="color: rgb(120, 172, 254);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;每个寄存器可以存储一个8比特的数据。<br  /></strong></span></p><p><span style="color: rgb(120, 172, 254);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></span><span style="color: rgb(0, 0, 0);">如下图所示:</span></p><p><img class="" data-ratio="0.3984375" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWVZEh9UbiafnkcqkV24fqJdeyz39PzT1GzJqN2o4goYJUtwGlsW0MYAA/640?wx_fmt=png" data-type="png" data-w="640" style=""  /></p><p><span style="color: rgb(0, 209, 0);"></span><br  /></p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWBibsz2iaOmyMepT8tYgpfUUicK5nL5sFYR4MgNHXtuGhBMNddIFMgicchQ/640?wx_fmt=png" data-type="png" data-w="1078"  /></p><p><strong style="font-size: 20px;"><br  /></strong></p><p><strong style="font-size: 20px;">三、如何一步一步地进行连接</strong></p><p><strong>1.连接电源、数据和地址总线</strong></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(0, 209, 0);">将Z80 CPU、<strong style="color: rgb(0, 209, 0);white-space: normal;">TC5517和<span style="color: rgb(0, 209, 0);">Z80 PIO</span></strong>芯片的Vcc引脚接+5V,GND引脚接0V.</span></p><p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(120, 172, 254);">由于用于输入程序的指拨开关是以8比特为一个单位指定内存地址的,所以只是用TC5517和上的A0~A7这8个引脚,把剩余的A8~A10引脚接到0V上,Z80 CPU也只用A0~A7这8个引脚,其余A8~A15不接线,用NC表示。将两个芯片的数据引脚D0~D7和地址引脚A0~A7分别相互连接。</span></p><p><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb(0, 209, 0);">这样Z80 CPU的A0~A7可以选择内存中的存储单元。</span></span></p><p><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>如下图所示:</p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWD0vCReJdj5ibsaxh2uLFZsSr8AELwOAOQmtqQXZt3UvmzibwV9gQqztg/640?wx_fmt=png" data-type="png" data-w="1078" style=""  /></p><p><br  /></p><p><strong>2.连接I/O</strong></p><p style="white-space: normal;"><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因为Z80 PIO上也有D0~D7的数据总线引脚,所以先把它们和Z80 CPU中带有同样代号的引脚连接起来,这样CPU和PIO就可以使用这8个引脚交换数据。</span></p><p style="white-space: normal;"><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(120, 172, 254);">接下来,把Z80 PIO的寄存器控制脚连接到Z80 CPU的地址总线引脚A0和A1上。这样Z80 CPU的A0~A1可以选择Z80 PIO中的寄存器。</span></p><p><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>如下图所示:</p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIW0mHdcZRTNObRxzcjl1W2SSFR0GgXgiaeR089BbrPibjVSUBca508AvcQ/640?wx_fmt=png" data-type="png" data-w="1078" style=""  /></p><p><strong><br  /></strong></p><p><strong>3.连接时钟信号</strong></p><p><span style="color: rgb(0, 209, 0);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;连接CPU和PIO的时钟CLK引脚到时钟发生器的8脚</strong></span></p><p><span style="color: rgb(0, 209, 0);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></span>如下图所示:</p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWuSCH1BvXyZ24kWahEhCrOK3icRw0o0cDg8LtibtreP1W925e11G9icqEA/640?wx_fmt=png" data-type="png" data-w="1078" style=""  /></p><p><br  /></p><p><strong>4.连接用于区分读写对象是内存还是I/O的引脚</strong></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="color: rgb(255, 76, 0);">①</span></strong><span style="color: rgb(0, 209, 0);">因为内存和PIO都连接到了CPU的A0~A1地址线上,这样CPU无法区分访问的是存储器的存储单元还是PIO的寄存器。<br  /></span></p><p><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Z80 CPU上的MREQ(内存请求)引脚和IORQ(I/O请求)引脚解决了这个问题。<br  /></span></p><p><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;若把TC5517的CE脚设成0,則电路被激活,若设成1則从电路中隔离,PIO的CE脚亦是如此设置。<br  /></span></p><p><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因此,将Z80 CPU的MREQ引脚接到TC5517的CE引脚上。<br  /></span></p><p><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;然后,将Z80 CPU的IORQ引脚连接到Z80 PIO的CE引脚和IORQ引脚上。</span></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><span style="color: rgb(255, 76, 0);">②</span></strong><span style="color: rgb(120, 172, 254);"><strong>对内存和I/O而言,还必须要分清CPU是要输入数据还是输出数据。</strong><br  /></span></p><p><span style="color: rgb(120, 172, 254);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在此,就要用到CPU的RD(读)和WR(写)两个引脚。<br  /></strong></span></p><p><span style="color: rgb(120, 172, 254);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因此,将CPU、内存、PIO三个芯片的这两个脚连在一起。</strong></span></p><p><strong><span style="color: rgb(255, 76, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></strong>如下图所示:</p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWZeab3oSAyy3qzoQNZlWyrLWPicch5KibrH65haHlbFEM6yB1HicaiaSxcw/640?wx_fmt=png" data-type="png" data-w="1078" style=""  /></p><p><br  /></p><p><strong>5.连接剩余的控制引脚</strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong style="color: rgb(120, 172, 254);white-space: normal;">CPU、内存、PIO三个芯片的其余控制引脚如下图进行连接。</strong></strong></p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIW77P153Zex2mqTYClTsLzUzAtl3w9APh6GoxXnIpevJG0oq675Efdiag/640?wx_fmt=png" data-type="png" data-w="1078" style=""  /></p><p><br  /></p><p><strong>6.连接外部设备,通过DMA输入程序</strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><span style="color: rgb(0, 209, 0);">使用2个指拨开关和1个按键开关,向地址总线引脚和数据总线引脚发送电信号,然后通过DMA将数据总线上的数据存储到内存。</span></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><span style="color: rgb(120, 172, 254);">&nbsp;但是,这些开关直接连接到内存的各个引脚上,在程序执行时,开关状态就会对电路产生影响。<br  /></span></p><p><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;所以,使用74367“三态总线缓冲器”,当该芯片的G1引脚和G2引脚同时为0时,电信号才能通过。</span></p><p><span style="color: rgb(120, 172, 254);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将CPU的BUSAK引脚与这些G1和G2连接。</span><strong><br  /></strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最后,外部设备电路连接如下图所示:<br  /></strong></p><p><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWpHgzRibrm8UypUPtgtFBFIpXngBzlUzTOZ6icW2os3DWXJXSaxAXdIWA/640?wx_fmt=png" data-type="png" data-w="1078" style=""  /></p><p><br  /></p><p><strong><br  /></strong></p><p><strong>7.连接用于输入输出的外部设备</strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><span style="color: rgb(0, 209, 0);"><strong>&nbsp;把另一个指拨开关和LED连接到Z80 PIO上,如下图所示。<br  /></strong></span></p><p><span style="color: rgb(0, 209, 0);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当微机运行起来后,指拨开关可用于从外部输入数据,LED用于向外部输出数据。</strong></span></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><span style="color: rgb(120, 172, 254);"><strong>&nbsp;用于输入数据的指拨开关与PIO的PA0~PA7引脚相连接。在此没有使用74367缓冲器是为了在程序运行中可以通过PIO从指拨开关获得输入的数据。</strong></span></p><p><span style="color: rgb(120, 172, 254);"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最后将74367和7404的Vcc和GND引脚分别连接+5V和0V上。</strong></span></p><p><strong><img class="" data-ratio="1.4387755102040816" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWBibsz2iaOmyMepT8tYgpfUUicK5nL5sFYR4MgNHXtuGhBMNddIFMgicchQ/640?wx_fmt=png" data-type="png" data-w="1078" style="white-space: normal;"  /></strong></p><p><strong><br  /></strong></p><p><strong>8.输入测试程序并进行调试</strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><span style="color: rgb(0, 209, 0);">该电路不能使用任何编程语言进行编程,只能通过拨动指拨开关将每段8比特的二进制数(机器语言)写进相应地址的内存单元中,如下图所示。</span></p><p><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程序是指令和数据的集合,每种CPU都有自己的指令集。这段程序实现了一个简单的功能,那就是通过拨动连接到Z80 PIO上的指拨开关控制LED的亮或灭。</span><span style="color: rgb(0, 209, 0);">&nbsp; &nbsp; </span><span style="color: rgb(0, 209, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p><img class="" data-ratio="1.2803347280334727" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIW9tcKODvDTAP2ibVAWNdCV6iaqnufO9yu4wT4fibV6JMAHDuW7tkzRrscA/640?wx_fmt=png" data-type="png" data-w="239" style="width: 236px;height: 300px;"  /></p><p><img class="" data-ratio="0.9531914893617022" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_png/LKgI6UN8ElafygecA4sIudtYiaWboKoIWLxjhv47AiblUUGjJoWZOAklHEDHFSS7Vnrnjf7N7hCshgKxDiccbWALg/640?wx_fmt=png" data-type="png" data-w="235" style=""  /></p><p><strong>测试步骤:</strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>&nbsp;1.接通电源后,按下Z80 CPU上的DMA请求开关。在这个状态下,拨动用于输入内存程序和指定内存输入地址的两个指拨开关,把上图代码清单所示的程序一行一行地输入内存。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.先来输入第一行代码,拨动用于指定地址的指拨开关,设定第一行代码所在的内存地址00000000。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.然后拨动用于输入程序的指拨开关,设定出程序代码00111110。<br  /></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.再按下用于向内存写入程序的按键开关。<br  /></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.输入第二行代码,设定出内存地址00000001,设定出程序代码11001111,再次按下按键开关。<br  /></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.反复进行2、3、4步骤,直至输入完程序代码的最后一行。<br  /></p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 7. 所有的指令都输入完成后,按下用于重置CPU的按键开关,控制DMA请求的快动开关就会还原成关闭状态。与此同时程序就运行起来了。<strong><br  /></strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程序一旦运行起来,就可以用第3个指拨开关控制LED的亮与灭。<br  /></strong></p><p><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LED不会只亮一下,而是一直亮着,时刻保持着指拨开关上的状态。</strong></p><p><strong><br  /></strong></p><p><strong>本节类容的基础请参考</strong><strong><span style="color: rgb(255, 76, 0);">计算机的制作(五)-全自动加法计算机</span></strong></p><p><strong><strong style="color: rgb(255, 76, 0);white-space: normal;"><span style="text-decoration: underline;"><br  /></span></strong></strong></p><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><hr style="font-size: 16px;white-space: normal;max-width: 100%;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"  /><p style="font-size: 16px;white-space: normal;max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;line-height: 25.6px;color: rgb(0, 128, 255);box-sizing: border-box !important;word-wrap: break-word !important;">请扫描下面二维码,关注该微信公众号,获取更多</span><span style="max-width: 100%;line-height: 25.6px;color: rgb(255, 41, 65);box-sizing: border-box !important;word-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;">生物医学工程</strong>专业及<strong style="max-width: 100%;box-sizing: border-box !important;word-wrap: break-word !important;">医工</strong><span style="max-width: 100%;line-height: 25.6px;color: rgb(0, 128, 255);">学习笔记</span></span><span style="max-width: 100%;color: rgb(0, 0, 0);box-sizing: border-box !important;word-wrap: break-word !important;"></span></p><p style="font-size: 16px;white-space: normal;max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);line-height: 25.6px;background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"><span style="max-width: 100%;line-height: 25.6px;color: rgb(255, 41, 65);box-sizing: border-box !important;word-wrap: break-word !important;"></span></p><p style="font-size: 16px;white-space: normal;max-width: 100%;min-height: 1em;color: rgb(62, 62, 62);line-height: 25.6px;text-align: center;background-color: rgb(255, 255, 255);box-sizing: border-box !important;word-wrap: break-word !important;"><img class="" data-ratio="1" data-s="300,640" src="http://mmbiz.qpic.cn/mmbiz_jpg/LKgI6UN8ElZnh0jXF3PjbBz7BBPnYH7wbDgfc3E2r7REMuN2lQqfuVM38HZO8Zx0rN0OLKywrjoH3P7QqDY44Q/640?wx_fmt=jpeg" data-type="jpeg" data-w="430" width="auto" style="box-sizing: border-box !important;word-wrap: break-word !important;visibility: visible !important;width: auto !important;"  /></p><p style="white-space: normal;"><br  /><span style="color: rgb(255, 41, 65);font-size: 16px;background-color: rgb(255, 255, 255);">笔记内容来自《计算机是怎么跑起来的》</span></p><p><strong><br  /></strong><br  /></p>
               
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Comsenz Inc. ( 浙ICP备17000336号-1 )

GMT+8, 2025-3-11 04:31 , Processed in 0.070290 second(s), 33 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表