DES加密系统整体设计顶层
DES加密系统整体设计顶层综上所述,DES加密系统整体设计顶层框图如下:
图1整体设计顶层框图
DES加密系统顶层设计模块的源代码:
module top( clk, TX_ reset, RX_reset, RXD, TXD, RX, RX_done, TX_ena, DECRYPT, CLKLXENABLE,Display, Control);
input clk;
input TX_ reset:
input RX_reset:
//input DES_ reset;
input RXD;
input RX;
input TX_ena;
input DECRYPT;
output TXD:
output RX_done;
output CLKLXENABLE;
output Display;
output Control;
//output flag;
reg Display;
reg Control;
reg LED_ Flag;
//reg flag;
wire SENDDATA;
wire DOUT;
wire [] DATAREADY;
wire FRAME_COUNTER;
wire DISPLAY_COUNTER;
wire E_DATA_RDY;
wire DATA_IN64;
wire DATA_OUT64;
wire rstn;
wire DIN;
wire TOTAL_FRAME;
wire RAM_ADDR;
wire BLOCK_COUNTER;
wire MODESEL;
wire DATA_IN64_EN;
wire TEST_OUT_REG;
//wire DES_reset_buf;
assign E_DATA_ RDY=1' b 1;
assignDIN= { DOUT,DOUT,DOUT,DOUT,DOUT,DOUT,DOUT,DOUT [ 7]};
assign RAMADDR=FRAME_COUNTER;
assign LED4=4' b0000;
//assign RAM_ADDR=FRAME_COUNTER;
assign MODESEL=1' b 1;
assign DISPLAY_COUNTER=RX?(FRAME_COUNTER+1):(FRAME_COUNTER-8); pram
Ipram(.clk(clk),.clk_slow(CLK16X),.data_in8(DIN),.data_in64(DATA_IN64),.modesel(MODESEL),.data_in8_ en(DATAREADY),.data_in64_ en(DATA_IN64_ EN),.addr_a(FRAME_COUNTER),.addr_b(BLOCK_COUNTER),.ramsel(FRAME_COUNTER),.data_ out8 (SENDDATA),.data out64(DATA_OUT64));
//IBUF rstpad(.I(DES_ reset),.O(DES_reset_ buf));
uartnew
Iuartnew(.RX(RX),.senddata(SENDDATA),.sendenable(TX_ena),.dout(DOUT),.dataready(DATAREADY),.rxd(RXD),.txd(TXD),.stdclk(clk),.rst(RX_reset),.rst2(TX_reset),.frame_counter(FRAME_COUNTER),.RX_done(RX_done),.test(CLKLXENABLE),.total_frame(TOTALFRAME),.clkl6x (CLK16X));
des
Ides(.reset(RX),.clk (clk),.data_ bus (DATA_OUT64),.TEST_OUT (TEST_OUT_REG),.e_data_rdy(E_DATA_RDY),.key(DATA_OUT64),.decrypt(DECRYPT),.data out(DATA_IN64),.d_ data_ rdy(DATA_IN64_ EN),.block_ counter (BLOCK_ COUNTER),.total_block(TOTAI-FRAME));
//always @(posedge clk)
// begin
//if (DES_ reset_ buf)
// flag<=0' b0;
//else
// flag<=0' b 1;
// end
/*********七段数码管显示***********/
/*********译码部分**************/
wire DisplayAl,DisplayA2,DisplayBl,DisplayB2;
HEX2LED myHLAl(DISPLAY_COUNTER,DisplayAl);
HEX2LED myHLA2(DISPLAY_COUNTER,DisplayA2);
HEX2LED myHLBl(DISPLAY一OUNTER,DisplayBl);
HEX2LED myHLB2(LED4,DisplayB2);
/*******为七段码显示生成一个快时钟********/
wire clk_ LED;
wire time_ seed;
assign time_seed=26' d50000; //综合下载时d=26' d25_ 000_ 000;
assign rstn=RX_reset; //仿真时assignd=26' d00_ 005;
Freq_Div myFreq_Div(
.Clk_sys(clk),
.Div(time_seed),
.Reset (rstn),
.Clk_user(clk_ LED)
);
/********七段码输出控制状态机*************/
always@(posedge clk_LED or negedge rstn)
begin
if(!rstn)
begin
Display<=0;
Control<=0;
LED_ Flag<=0;
end
else
begin
if(LED_Flag===2' b00)
begin
Display<=DisplayAl:
Control<=4' b0111;
LED Flag<=2' b01;
end
else if(LED_Flag==2' b01)
begin
Display<=DisplayA2;
Control<=4' b1011;
LEDes Flag<=2' b 10;
end
elseif(LED_Flag==2' b10)
begin
Display<=DisplayBl;
Control<=4' b1101;
LEDes Flag<=2' b 11;
end
else if(LED_Flag====2' b 11)
begin
Display<=DisplayB2;
Control<=4' b1110;
LED_ Flag<=2' b00;
end
else
LED_Flag<=2' b00;
end
end
endmodule
DES加密系统顶层设计中,des. v, pram. v, uartnew. v,FrecLDiv. v, HEX2LED. v为系统调用函数。
谢谢楼主分享 DES加密系统整体设计顶层 DES加密系统整体设计顶层
页:
[1]