已阅读5页,还剩13页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
PROJECT REPORT实验课程: 数字电路EDA实验实验名称: 医用生产线【Requirement】Be able to preset the number of tablets per bottle, for example ,fifty tablets each bottle. Every box contains twenty-four bottles, stop count until 18 Use software to design the simulation, Quartus II will be better. 【Principle and framework given by teacher】【Our system framework】【1.0】【2.0】【Modular design and simulation】Keyboard prcessor【Function introduction】 As project requirement, we can optional set keyboard size and what is the key arrangement. However , in consideration of engineering application, we chose 4*4 keyboard , as indicated below.Just as the picture illustrated above, We define “A” are the first counter enable pin .When the A pin is high , corresponding counter accept 8-bit number as its period. So as B and C.D is the reset put which clear the number of register. *and # are use as back-up. Basic on this keyboard framework we can easily achieve our program use VHDL.At first ,we divide the keyboard into a 4 row and 4 column and then judge its value using case sentence.【Programming】LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY KEYBOARD IS PORT(CLK: IN STD_LOGIC;ROW: IN STD_LOGIC_VECTOR(3 DOWNTO 0); /行向量COL: IN STD_LOGIC_VECTOR(3 DOWNTO 0); /列向量DATA: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);F:OUT STD_LOGIC; /给寄存器判断是否有输入EN1: OUT STD_LOGIC;EN2: OUT STD_LOGIC;EN3: OUT STD_LOGIC);END ENTITY KEYBOARD;ARCHITECTURE RTL OF KEYBOARD ISSIGNAL MID: STD_LOGIC_VECTOR(7 DOWNTO 0);SIGNAL NUM: STD_LOGIC_VECTOR(3 DOWNTO 0);BEGINPROCESS(CLK,ROW,COL)BEGINMID NUM NUM NUM NUM NUM NUM NUM NUM NUM NUM NUM=1010;EN1=0;EN2=0;EN3 NUM=1111;EN1=1;EN2=0;EN3 NUM=1111;EN1=0;EN2=1;EN3 NUM=1111;EN1=0;EN2=0;EN3 NUM=1111;/1111的时候表示数据无效END CASE;END IF;DATA=NUM;F=(NUM(0) AND NUM(1) AND NUM(2) AND NUM(3);END PROCESS;END RTL;【Simulation waveform】Register【Function introduction】 This register has 4-bit input and 8-bit output, and a input named “carry” is also add to this register . When carry equal to “1”, put the 4-bit input to high output pin, when the other, the 4-bit input will be put into low output pin.【programming】LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY REGISTER_DIY IS PORT(F: IN STD_LOGIC;CLK: IN STD_LOGIC;CARRY : IN STD_LOGIC;RIN: IN STD_LOGIC_VECTOR(3 DOWNTO 0);OUT_LOW: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);OUT_HIGH: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);END REGISTER_DIY;ARCHITECTURE RTL OF REGISTER_DIY IS SIGNAL F_IN: STD_LOGIC_VECTOR(1 DOWNTO 0);BEGIN PROCESS(CLK,F,CARRY)BEGIN F_IN OUT_LOW OUT_HIGH NULL;END CASE;END IF;END PROCESS;END RTL;【Simulation waveform】BCD to binary convertorAt the very beginning, we should ask a question to ourselves. Why we need a BCD to binary converter? We use the keyboard to put in the number of pills per bottle which is from 0 to 99, it is BCD, but the counter only counts the binary number, so we need to convert the BCD to binary numbers.【Function introduction】At First, we divide the BCD into high bit and low bit, then use two registers to store them and convert high bit and low bit respectively. When we convert the high bit, we assume the low bit is zero, then convert the BCD with low bit zero to binary numbers. For example,0010(high bit) 00100000(BCD) 00010100(binary)Then we convert the low bit, similarly, we assume the high bit is zero, and then convert the BCD with high bit zero to binary numbers. For example,0010(low bit) 00000010(BCD) 00000010(binary)Finally, we need an adder to add the two binary numbers(high bit and low bit) to get the final binary numbers. Then we have finished BCD to binary conversion.00100010(BCD) 00010100(high bit)+00000010(low bit) 00010110(binary number)【Programming】【BCD to binary (high-bit)】library IEEE; use IEEE.std_logic_1164.all; entity BCD_binary_high is port ( CLK : IN STD_LOGIC; BCD_high: in bit_vector(3 downto 0); binary_high:out bit_vector(7 downto 0); end BCD_binary_high; architecture RTL of BCD_binary_high is begin process(BCD_high,CLK) begin IF CLKEVENT AND CLK=1 THEN case BCD_high is when 0000 = binary_high binary_high binary_high binary_high binary_high binary_high binary_high binary_high binary_high binary_high binary_high binary_low binary_low binary_low binary_low binary_low binary_low binary_low binary_low binary_low binary_low binary_low=01000000; end case; end process; end RTL;【Simulation waveform】Figure 1 BCD to binary converter(high-bit)Figure 2BCD to binary converter(low-bit)Adder【Function introduction】we need an adder to add the two binary numbers(high bit and low bit) to get the final binary numbers. Then we have finished BCD to binary conversion.【Programming】library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity Unsigned_adder is port ( A,B: in std_logic_vector(7 downto 0); S: out std_logic_vector (7 downto 0); end Unsigned_adder ; architecture RTL of Unsigned_adder is begin S=A + B; end RTL;【Simulation waveform】Simulate successfully achieved the function of adder, but it has some delay and interference. I think it may caused by Race and Hazard.Counter【Function introduction】Set D and Q as the signal variable .D resource from the key board .Q is the internal signal of counter ,it circulates upon D.Once D has been settle ,Q is upcount for D times.When Q run for D times, Theres a OUTPUT pulse through Cd .One circulation end.【Programming】library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity bc3 is port(CLK:in std_logic; D:IN std_logic_vector(7 downto 0); Q:buffer std_logic_vector(7 downto 0); Cd:out std_logic;EN:in std_logic); end; architecture ONE of bc3 is begin process(CLK) begin if CLKevent and CLK=1and EN=0then Q=D; if QD-1 then Q=Q+1; else Q=00000000; end if
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 年产贴敷类产品2000万贴可行性研究报告
- 功能性聚酯热收缩薄膜生产项目可行性研究报告
- 胶体金及理化类检测试剂的研发及生产项目可行性研究报告
- 年产10000吨还原物项目可行性研究报告
- 水处理剂系列产品生产项目可行性研究报告
- 抢救车的管理和使用
- 2024年电解电容器项目经营分析报告
- 2024年运载火箭项目融资计划书
- 两位数加减一位数水平考核训练题带答案
- 江苏省无锡市阴山中学2024届中考物理考试模拟冲刺卷含解析
- 《牙周病学》教学大纲
- 龙门吊危险源辨识及评价
- 科技感星空背景动态PPT_模板
- 汽车减振器的设计论文设计说明
- GB_T 20980-2021 饼干质量通则(高清-现行)
- 工程建设标准强制性条文实施情况总结
- 220kV线路工程铁塔组立施工方案要点
- 民办职业培训机构暂停办学申请表
- 水平定向钻进管道穿越单元工程施工质量验收评定表教学教材
- AKTA系统手动命令指南PPT课件
- 混凝土重力坝毕业设计(共44页)
评论
0/150
提交评论