基本完成译码器的实验设计
This commit is contained in:
parent
4cc5f79399
commit
e62298710e
|
@ -488,4 +488,111 @@
|
||||||
</root>
|
</root>
|
||||||
</mxGraphModel>
|
</mxGraphModel>
|
||||||
</diagram>
|
</diagram>
|
||||||
|
<diagram id="AdvlFsg3ZpSJXzzAPVCX" name="译码器">
|
||||||
|
<mxGraphModel dx="480" dy="394" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="1" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0"/>
|
||||||
|
<mxCell id="1" parent="0"/>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-2" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1" source="8LwFoKWnl6urZ68ISw2w-1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="210" y="198" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-3" style="edgeStyle=none;rounded=0;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;strokeWidth=3;fontSize=18;endArrow=none;endFill=0;" edge="1" parent="1" source="8LwFoKWnl6urZ68ISw2w-1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="210" y="239.8571428571429" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-4" style="edgeStyle=none;rounded=0;html=1;exitX=0;exitY=0.75;exitDx=0;exitDy=0;strokeWidth=3;fontSize=18;endArrow=none;endFill=0;" edge="1" parent="1" source="8LwFoKWnl6urZ68ISw2w-1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="210" y="282.71428571428567" as="targetPoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-1" value="Decoder" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=3;fontStyle=1;fontSize=18;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="300" y="155" width="120" height="170" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-10" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="230.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="230" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-11" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="250.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="250" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-12" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="210.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="210" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-13" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="270.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="270" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-14" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="190.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="190" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-15" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="290.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="290" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-16" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="310.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="310" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-17" style="edgeStyle=none;html=1;exitX=0;exitY=0.25;exitDx=0;exitDy=0;fontSize=18;strokeWidth=3;rounded=0;endArrow=none;endFill=0;" edge="1" parent="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="420" y="170.5" as="targetPoint"/>
|
||||||
|
<mxPoint x="510" y="170" as="sourcePoint"/>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-18" value="$$A$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="152" y="177" width="80" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-19" value="$$B$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="152" y="219" width="80" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-20" value="$$C$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="152" y="263" width="80" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-21" value="$$Y_0$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="150" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-22" value="$$Y_1$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="170" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-23" value="$$Y_2$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="190" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-24" value="$$Y_3$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="210" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-25" value="$$Y_4$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="230" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-26" value="$$Y_5$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="250" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-27" value="$$Y_6$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="270" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="8LwFoKWnl6urZ68ISw2w-28" value="$$Y_7$$" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="485" y="290" width="100" height="40" as="geometry"/>
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
</mxfile>
|
</mxfile>
|
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 40 KiB |
|
@ -0,0 +1,65 @@
|
||||||
|
# 译码器
|
||||||
|
|
||||||
|
## 一、实验介绍
|
||||||
|
|
||||||
|
译码器(Decoder)是一种数字电路组件,用于将输入的编码信息转换为相应的输出信号。它的作用是解码输入信号,根据输入的编码模式选择并激活相应的输出线路。
|
||||||
|
|
||||||
|
译码器的工作原理是根据输入编码的模式选择并激活相应的输出线路。例如,一个 3-8 译码器接收 3 位二进制编码作为输入,根据输入编码的不同,选择并激活对应的输出线路。具体来说,如果输入编码为 `000`,那么译码器将激活输出线路 0;如果输入编码为 `001`,则激活输出线路 1,依此类推。
|
||||||
|
|
||||||
|
译码器广泛应用于数字系统和计算机中的多种场景,包括:
|
||||||
|
|
||||||
|
- 存储器访问:在存储系统中,译码器用于选择要读取或写入的存储单元。根据存储器地址的编码,译码器激活对应的存储单元。
|
||||||
|
- 显示驱动:在数码管显示或 LED 显示中,译码器用于将输入的数字编码转换为相应的数码管段或 LED 灯的亮灭控制信号。
|
||||||
|
- 地址解码:在计算机系统中,译码器用于将指令地址编码解码为特定的控制信号,以选择执行特定操作的电路路径。
|
||||||
|
- 数据选择和交换:在数据通路中,译码器用于选择不同的数据输入或输出路径,根据控制信号将数据流动到特定的目标。
|
||||||
|
|
||||||
|
## 二、实验目的
|
||||||
|
|
||||||
|
1. 理解译码器的原理和功能。
|
||||||
|
2. 学会使用 Verilog 描述译码器的行为。
|
||||||
|
3. 掌握 Verilog 仿真工具的使用,验证译码器的正确性。
|
||||||
|
|
||||||
|
## 三、实验要求
|
||||||
|
|
||||||
|
1. 使用 Verilog 描述译码器的行为。
|
||||||
|
2. 通过所有测试点。
|
||||||
|
|
||||||
|
## 四、实验步骤
|
||||||
|
|
||||||
|
这里我们以 3-8 译码器为例子:
|
||||||
|
|
||||||
|
### 1. 框图
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- $A$ 、 $B$ 、 $C$ 是译码器的三个输入信号。
|
||||||
|
- $Y_0$ ~ $Y_7$ 是译码器的八个输出信号。
|
||||||
|
- $Y$ 的输出是二进制序列 $ABC$ 的十进制表示:当 $ABC$ 为 011 时对应的 $Y_3$ 输出为 1 其他为 0。
|
||||||
|
|
||||||
|
### 2. 真值表
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 3. 顶层模块
|
||||||
|
|
||||||
|
```verilog
|
||||||
|
module Decoder3_8(
|
||||||
|
input wire A,
|
||||||
|
input wire B,
|
||||||
|
input wire C,
|
||||||
|
output wire [7: 0] Y
|
||||||
|
);
|
||||||
|
|
||||||
|
// TODO:你的代码实现
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
在上述代码中,顶层模块名为 `Decoder3_8`,它有四个端口:
|
||||||
|
|
||||||
|
- $A$ 、 $B$ 、 $C$ 是译码器的三个输入信号。
|
||||||
|
- $Y_0$ ~ $Y_7$ 是译码器的八个输出信号。
|
||||||
|
- $Y$ 的输出是二进制序列 $ABC$ 的十进制表示:当 $ABC$ 为 011 时对应的 $Y_3$ 输出为 1 其他为 0。
|
||||||
|
|
||||||
|
请补充代码,完成 3-8 译码器的设计。
|
Loading…
Reference in New Issue