这是一个真实的机器人的运动程序.是我的教授给学生们一起研究的.任务就是让我把它的实际的意思给注释出来.每一步是完成的什么.或者说是程序所描述的大致的意思是什么?我也就想问问这里的高手了.高手们都给看看吧.先谢谢了.
关于程序本身的注释,能写多少就帮忙给写多少吧.我就学习学习了.
10分不是实际的分数.可以给更高的分数.
有问题就写在这里.我常来看的.谢谢
我发帖的时候.系统提示我.帖子太长了.无法操作.我就改改方法.
请各位高手耐心一点点.发个邮件,我回复邮件的时候附带这个机器人的运行程序.谢谢
邮箱是:blueink_200451@hotmail.com
注明是:机器人程序.
library ieee;
use ieee.std_logic_1164.all;
entity line_test is
port(
sw_reset : in std_logic;
clk : in std_logic;
sw_start : in std_logic;
sensor_rx : in std_logic_vector(7 downto 0);
sensor_tx : out std_logic;
f_led : out std_logic_vector(1 downto 0);
b_led : out std_logic_vector(1 downto 0);
d_led : out std_logic_vector(1 downto 0);
buz : out std_logic;
seg : out std_logic_vector(7 downto 0);
sensor_out : out std_logic;
r_data : out std_logic_vector(3 downto 0);
l_data : out std_logic_vector(3 downto 0));
end line_test;
architecture hb of line_test is
type mode_d is (stop, start);
signal mode : mode_d;
signal cnt_r : integer range 0 to 7;
signal cnt_l : integer range 0 to 7;
type ar_cnt_data is array (0 to 18) of integer range 0 to 4096;
constant cnt_data : ar_cnt_data :=
( 0 => 4000,
1 => 3850,
2 => 3700,
3 => 3550,
4 => 3350,
5 => 3200,
6 => 3000,
7 => 2850,
8 => 2700,
9 => 2500,
10 => 2300,
11 => 2150,
12 => 2000,
13 => 1800,
14 => 1650,
15 => 1450,
16 => 1300,
17 => 1150,
18 => 1000);
signal r_cnt : integer range 0 to 4096;
signal l_cnt : integer range 0 to 4096;
signal r_cnt_data : integer range 0 to 4096;
signal l_cnt_data : integer range 0 to 4096;
signal r_clk_cnt : integer range 0 to 4096;
signal l_clk_cnt : integer range 0 to 4096;
signal cnt_1m : integer range 0 to 21;
signal clk_1m : std_logic;
signal cnt_10k : integer range 0 to 1023;
signal clk_10k : std_logic;
signal cnt_2k : integer range 0 to 8191;
signal r_com : integer range 0 to 20;
signal l_com : integer range 0 to 20;
signal reg_sensor_rx0 : std_logic_vector(9 downto 0);
signal reg_sensor_rx1 : std_logic_vector(9 downto 0);
signal reg_sensor_rx2 : std_logic_vector(9 downto 0);
signal reg_sensor_rx3 : std_logic_vector(9 downto 0);
signal reg_sensor_rx4 : std_logic_vector(9 downto 0);
signal reg_sensor_rx5 : std_logic_vector(9 downto 0);
signal reg_sensor_rx6 : std_logic_vector(9 downto 0);
signal reg_sensor_rx7 : std_logic_vector(9 downto 0);
signal sensor : std_logic_vector(7 downto 0);
signal sser : std_logic_vector(5 downto 0);
signal resetn : std_logic;
signal reg_sw_start : std_logic_vector(1 downto 0);
signal stop_cnt : integer range 0 to 499999;
signal cnt_motor : integer range 0 to 49;
signal clk_motor : std_logic;
signal sen_cnt : integer range 0 to 49;
begin
......
......(只是一小部分)
不好意思,你给出的这一部分什么意思也没有,全部都是信号声明和模块声明。并且,就给出程序,所有人都很难看懂。硬件程序和软件不同,一般来说,只有当知道外围电路,端口定义的时候,才可能能看懂内部。你至少要提供出准确的端口定义。就是说entity部分的信号都代表什么。这个没有别人能知道。
to benjaminweber :
thank you very much;