Uploaded by tonigrant19

Курсовая ВИМТ (2 курс 2 сем)

advertisement
ФЕДЕРАЛЬНОЕ АГЕНТСТВО СВЯЗИ
Федеральное государственное бюджетное образовательное
учреждение высшего образования
«Санкт-Петербургский государственный университет телекоммуникаций
им. проф. М. А. Бонч-Бруевича»
_____________________________________________________________________________
Кафедра программной инжене́рии и цифровой вычислительной техники
Курсовой проект
по дисциплине
«Вычислительная и микропроцессорная техника»
«Конечный автомат, работающий по принципу автомата Мили»
Выполнил:
ст. гр. ИКТ-615
Панфилов Д.О.
Номер варианта: 89
Номер зачетной книжки: 1704389
Проверила:
ст.преп. кафедры
Неелова О.Л.
Санкт-Петербург
2018
Содержание
1. Задание на курсовое проектирование……………………………………………………3
2. Таблицы переходов и состояний……………………………………………………….....3
3. Переходы при х=0 и х=1……………………………………………………………...........4
4. Таблица истинности для КЦУ…………………………………………………………....4
5. Карты Карно и выражения для N0, N1 и N2…………………………………………....5
6. Принципиальная электрическая схема для КЦУ……………………………………...6
7. Листинг программы работы устройства……………………………………………..7
8. Граф переходов………………………………………………………………………………8
9. Листинг программы karno.vhd…………………………………………………………...9
10. Временная диаграмма для karno.vhd…………………………………………………9
11. Выводы……………………………………………………………………………………..9
12. Список использованной литературы……………………………………………….10
1. Задание на курсовое проектирование
Синтезировать конечный автомат, работающий по принципу автомата
Мили. В синтез входит построение схемы КЦУ автомата, временные
диаграммы его работы, программа на VHDL для реализации автомата на
макете в FPGA CycloneV и диаграмма переходов автомата. Условие для “x=1”
– равнозначность входных сигналов “a” и “b”.
Структура автомата представлена следующим образом:
2. Таблицы переходов и состояний
Таблица переходов и таблица состояний автомата будут иметь
следующий вид:
Таблица переходов 9
x
S0
S1
S2
S3
S4
S5
S6
S7
X=0
S3
S6
S1
S7
S0
S2
S4
S5
X=1
S1
S4
S6
S7
S2
S3
S5
S0
Таблица состояний 8
x
S0
S1
S2
S3
S4
S5
S6
S7
X=0
0
2
4
6
1
3
5
7
X=1
1
3
5
7
2
4
6
0
3
3. Переходы при х=0 и х=1
При x=0 автомат будет совершать переходы:
S0 -> S3 -> S7 -> S5 -> S2 -> S1 -> S6 -> S4 -> S0 -> … или
0 -> 6 -> 7 -> 3 -> 4 -> 2 -> 5 -> 1 -> 0 -> … ,
А при x=1:
S0 -> S1 -> S4 -> S2 -> S6 -> S5 -> S3 -> S7 -> S0 -> … или
1 -> 3 -> 2 -> 5 -> 6 -> 4 -> 7 -> 0 -> 1 -> … .
4. Таблица истинности для КЦУ
Записываю таблицу истинности для КЦУ автомата, именуя входы Si-1 M[2..0], а выходы Si - N[2..0]:
M2
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
M1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
M0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
x
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
4
N2
1
0
1
0
0
0
1
0
0
1
1
1
0
1
0
1
N1
1
0
1
0
1
1
0
1
1
0
0
1
0
0
0
1
N0
0
1
1
1
1
1
0
0
0
1
1
0
1
0
0
1
5. Карты Карно и выражения для N0, N1 и N2
Записываю выражения для выходов, используя карты Карно:
Для N0:
(M1) and not(M0) and not(x) or
not(M2) and not(M0) and (x) or
(M0) and not(M2) and not(M1) or
(M2) and (M1) and (M0) and (x) or
not(M1) and not(M0) and(x) or
not(M1) and (M0) and not(x)
Для N1:
not(M2) and not(M0) and not(x) or
(x) and not(M2) and (M1) or
(M2) and (M0) and (x) or
not(x) and not(M2) and not(M1) or
not(M1) and not(M0) and not(x)
Для N2:
not(M2) and (M0) and not(x) or
not(x) and not(M2) and not(M1) or
not(M1) and (M0) and not(x) or
(M2) and (x)
5
6. Принципиальная электрическая схема КЦУ
6
7. Листинг программы работы устройства
library ieee;
use ieee.std_logic_1164.all;
entity panfilov is
port(clk:in std_logic;
a,b:in std_logic;
reset:in std_logic;
ind:out bit_vector(6 downto 0));
end entity;
architecture rtl of panfilov is
type state_type is (s0,s1,s2,s3,s4,s5,s6,s7);
signal state: state_type;
signal input:std_logic;
signal output:std_logic_vector(2 downto 0);
begin
input<=(a)xnor(b);
process (clk,reset)
begin
if reset='1' then
state<=s0;
elsif (rising_edge(clk)) then
case state is
when s0=>
if input='1' then
state<=s2;
state<=s1;
end if;
else
when s6=>
state<=s3;
if input = '1' then
end if;
state<=s5;
when s1=>
else
if input='1' then
state<=s4;
state<=s4;
end if;
else
when s7=>
state<=s6;
if input = '1' then
end if;
state<=s0;
when s2=>
else
if input='1' then
state<=s5;
state<=s6;
end if;
else
end case;
state<=s1;
end if;
end if;
end process;
when s3=>
process(state,input)
if input='1' then
begin
state<=s7;
case state is
else
when s0=>
state<=s7;
if input = '1' then
end if;
output<="001";
when s4=>
else
if input='1' then
output<="000";
state<=s2;
end if;
else
when s1=>
state<=s0;
if input='1' then
end if;
output<="011";
when s5=>
else
if input='1' then
output<="010";
state<=s3;
end if;
else
7
when s2=>
if input='1' then
output<="101";
else
output<="100";
end if;
when s3=>
if input='1' then
output<="111";
else
output<="110";
end if;
when s4=>
if input='1' then
output<="010";
else
output<="001";
end if;
when s5=>
if input='1' then
output<="100";
else
output<="011";
end if;
when s6=>
if input='1' then
output<="110";
else
output<="101";
end if;
when s7=>
if input = '1' then
output<="000";
else
output<="111";
end if;
end case;
end process;
process(output)
begin
case output is
when "000"=>ind<="1000000";
when "001"=>ind<="1111001";
when "010"=>ind<="0100100";
when "011"=>ind<="0110000";
when "100"=>ind<="0011001";
when "101"=>ind<="0010010";
when "110"=>ind<="0000010";
when "111"=>ind<="1111000";
end case;
end process;
end rtl;
8. Граф переходов
8
9. Листинг программы karno.vhd
library ieee;
use ieee.std_logic_1164.all;
entity Karno is
port(x:in std_logic;
M:in std_logic_vector(2 downto 0);
N:out std_logic_vector(2 downto 0)
);
end Karno;
architecture BBB of Karno is
begin process(M,x)
begin
N(0)<=(((M(1)) and (not(M(0))) and (not(x))) or ((not(M(2))) and
(not(M(0))) and (x)) or ((M(0)) and (not(M(2))) and (not(M(1)))) or
((M(2)) and (M(1)) and (M(0)) and (x)) or ((not(M(1))) and (not(M(0)))
and (x)) or ((not(M(1))) and (M(0)) and (not(x))))
N(1)<=(((not(M(2))) and (not(M(0))) and (not(x))) or ((x) and
(not(M(2))) and (M(1))) or ((M(2)) and (M(0)) and (x)) or ((not(x))
and (not(M(2))) and (not(M(1)))) or ((not(M(1))) and (not(M(0))) and
(not(x))))
N(2)<=(((not(M(2))) and (M(0)) and (not(x))) or ((not(x)) and
(not(M(2))) and (not(M(1)))) or ((not(M(1))) and (M(0)) and (not(x)))
or ((M(2)) and (x)))
end process;
end;
10. Временная диаграмма для karno.vhd
11. Выводы
9
Список использованной литературы
1.
Базовые цифровые устройства телекоммуникационных систем / О. Л.
Неелова;СПбГУТ. – СПб., 2006. – 40 с.
10
Download