成绩
指导教师
日期
张歆奕
2015-5-24
五邑大学实验报告
实验课程名称:
电子系统EDA
院系名称: 信息学院
专业名称: 电子信息工程
实验项目名称: 基于原理图的跑表设计
班级: 120703 学号: 50
报告人: 牛世伟
实验目的
1、练习使用 Verilog HDL 语言设计实现数字电路;
2、练习利用 Verilog HDL 语言和状态机设计电路。
二、实验原理
1、用数码管除了可以显示 0~9 的阿拉伯数字外,还可以显示一些英语字母。
2、数码管由 7 段显示输出,利用 7 个位的组合输出,就可以形成部分英语字母和 0~9 十个数字的显示。 0~9 和常见字母的 7 段显示关系如下图所示。
共阴段码
共阳在共阴的相应段编码取反即可。
基于一位数码管的学号显示
Verilog源代码
module xue_hao_dis(out,clk,rst,co); //模块声明
input clk,rst; //输入信号
output reg co; //输出信号
output reg [6:0] out; //输出信号
reg [2:0] state; //中间变量
parameter s0=3'b000,s1=3'b001,s2=3'b010,s3=3'b011;
parameter s4=3'b100,s5=3'b101,s6=3'b110,s7=3'b111;
always @(posedge clk or posedge rst)
begin
if(rst)
begin state<=s0; end
else
begin
case (state)
s0: begin state<=s1; out<=7'b1001111; co<=0; end
s1: begin state<=s2; out<=7'b0010010; co<=0; end
s2: begin state<=s3; out<=7'b0000001; co<=0; end
s3: begin state<=s4; out<=7'b0001111; co<=0; end
s4: begin state<=s5; out<=7'b0000001; co<=0; end
s5: begin state<=s6; out<=7'b0000110; co<=0; end
s6: begin state<=s7; out<=7'b0100100; co<=0; end
s7: begin state<=s0; out<=7'b0000001; co<=1; end
default : begin state<=s0; end
endcase
end
end
endmodule
采用8个状态,显示12070350;
仿真结果
基于8个数码管的花样学号显示
module xue_hao_huashi(clk,rst,out0,out1,out2,out3,
out4,out5,out6,out7);//模块声明
input clk,rst; //输入信号
output reg[6:0] out0,out1,out2,ou
学号显示EDA 来自淘豆网m.daumloan.com转载请标明出处.