西电计科大三下SOC微体系结构设计作业合集

目录

一.VHDL设计作业

1.基于硬件描述语言的3-8译码器逻辑电路设计

2.8位双向移位寄存器设计

3.基于有限状态机的自助售票系统设计

4.按键消抖电路设计

5.同步环形FIFO设计

6.线上实验——时钟模块设计

7.线上实验——原码二位乘法器设计 

8.线上实验——布斯乘法器设计


一.VHDL设计作业

源文件、测试文件及仿真结果

1.基于硬件描述语言的3-8译码器逻辑电路设计

根据3-8译码器基本原理,采用硬件描述语言设计一个3-8译码器逻辑电路,并给出仿真结果。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity decoder3_8 is
    Port (  
        OE: in std_logic;
        X: in std_logic_vector(2 downto 0);
        Y: out std_logic_vector(7 downto 0)
    );
end decoder3_8;

architecture Behavioral of decoder3_8 is
begin
process(OE,X)
begin
    if OE='0' then Y<="00000000";
    elsif OE='1'then
        Case X is
            When "000" =>Y<="11111110";
            When "001" =>Y<="11111101";
            When "010" =>Y<="11111011";
            When "011" =>Y<="11110111";
            When "100" =>Y<="11101111";
            When "101" =>Y<="11011111";
            When "110" =>Y<="10111111";
            When "111" =>Y<="01111111";
            When others =>Y<="11111111";
        END CASE;    
   end if;
end process;
end Behavioral;

testbench:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity decoder3_8_tb is
--  Port ( );
end decoder3_8_tb;

architecture structural of decoder3_8_tb is
component decoder3_8
    port(
        OE: in std_logic;
        X: in std_logic_vector(2 downto 0);
        Y: out std_logic_vector(7 downto 0)
    );
end component;
signal oe:std_logic;
signal input:std_logic_vector(2 downto 0);
signal output:std_logic_vector(7 downto 0);
begin
d1:decoder3_8 port map(oe,input,output);

ensure:process
    begin
        oe<='0';
        wait for 50ns;
        oe<='1';
        wait;
end process;

sel:process
    begin
        input<="000";
        wait for 20ns;
        input<="001";
        wait for 20ns;
        input<="010";
        wait for 20ns;
        input<="011";
        wait for 20ns;
        input<="100";
        wait for 20ns;
        input<="101";
        wait for 20ns;
        input<="110";
        wait for 20ns;
        input<="111";
        wait for 20ns;
end process;
end structural;

2.8位双向移位寄存器设计

采用硬件描述语言实现8位双向移位寄存器,其功能包括异步置零,同步置数,左移,右移和保持状态不变等5种功能。其中输入端口包括8位并行数据、两位的选择信号和两个1位串行数据,输出是8位并行数据。当RESET信号为低电平时,寄存器的输出被异步置零;否则当RESET=1时,与时钟有关的四种功能由输入信号MODE决定。请给出仿真结果。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity shift_register is
    Port (
        clk,reset,left,right:in std_logic;
        mode:in std_logic_vector(1 downto 0);
        input_data:in std_logic_vector(7 downto 0);
        output_data:inout std_logic_vector(7 downto 0)
    );
end shift_register;

architecture Behavioral of shift_register is
begin
process(reset,clk,mode)

begin
    if (reset='0')then
        output_data<="00000000";
    elsif(reset='1'and clk='1')then
        case mode is
            when "00"=>output_data<=output_data;
            when "01"=>output_data<=input_data;
            when "10"=>
                    output_data(0)<=left;
                    output_data(7)<=output_data(6);
                    output_data(6)<=output_data(5);
                    output_data(5)<=output_data(4);
                    output_data(4)<=output_data(3);
                    output_data(3)<=output_data(2);
                    output_data(2)<=output_data(1);
                    output_data(1)<=output_data(0);              
            when "11"=>
                    output_data(0)<=output_data(1);
                    output_data(1)<=output_data(2);
                    output_data(2)<=output_data(3);
                    output_data(3)<=output_data(4);
                    output_data(4)<=output_data(5);
                    output_data(5)<=output_data(6);
                    output_data(6)<=output_data(7);
                    output_data(7)<=right;
            when others=>output_data<=output_data;
        end case;         
    end if;
end process;

end Behavioral;

testbench: 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity shift_register_tb is
--  Port ( );
end shift_register_tb;

architecture Behavioral of shift_register_tb is
component shift_register
port(
        clk,reset,left,right:in std_logic;
        mode:in std_logic_vector(1 downto 0);
        input_data:in std_logic_vector(7 downto 0);
        output_data:inout std_logic_vector(7 downto 0)   
);
end component;
signal clk,reset,left,right:std_logic;
signal mode:std_logic_vector(1 downto 0);
signal input_data:std_logic_vector(7 downto 0);
signal output_data:std_logic_vector(7 downto 0);   
begin
sr1:shift_register port map(clk,reset,left,right,mode,input_data,output_data);

clock_gen:process
    begin
        left<=output_data(7);
        right<=output_data(0);
        clk<='0';
        wait for 10ns;
        clk<='1';
        wait for 10ns;
end process;

reset_gen:process
    begin
        reset<='0';
        wait for 25ns;
        reset<='1';
        wait;
end process;

mode_test:process
    begin
        mode<="00";
        wait for 30ns;
        mode<="01";
        input_data<="00001111";
        wait for 30ns;
        mode<="10";
        wait for 200ns;
        mode<="01";
        input_data<="00001111";
        wait for 30ns;
        mode<="11";
        wait for 200ns;
end process;

end Behavioral;

3.基于有限状态机的自助售票系统设计

某自助售票系统只能接收 5元和10元纸币,若一张票的价格设定为 25元。
请利用有限状态机设计该售票系统,
1. 首先给出状态说明,然后画出具体的状态图及说明状态转移关系。
2. 并完成硬件描述语言程序设计。

3.将第1和2题的答案做成word文档上传。

4.扩展要求(加分10分):增加20元纸币输入。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity ticket_state_machine is
    Port (
        clk,reset:in std_logic;
        input_money:in std_logic_vector(2 downto 0);
        return_money:out std_logic_vector(2 downto 0);
        output_ticket:out std_logic
    );
end ticket_state_machine;

architecture Behavioral of ticket_state_machine is
type states is (m0,m5,m10,m15,m20,m25,m30,m35,m40);
signal current_state,next_state:states;
begin

start:process(reset,clk)
    begin
        if(reset='1')then
            current_state<=m0;
        elsif(reset='0'and clk='1'and clk'event)then
            current_state<=next_state;
        end if;         
end process;

state_machine:process(current_state,input_money)
    begin
        case current_state is
            when m0=>
                output_ticket<='0';
                return_money<="000";
                case input_money is
                    when"000"=>next_state<=m0;
                    when"001"=>next_state<=m5;
                    when"010"=>next_state<=m10;
                    when"100"=>next_state<=m20;
                    when others=>next_state<=current_state;
                end case;
            when m5=>
                output_ticket<='0';
                return_money<="000";
                case input_money is
                    when"000"=>next_state<=m5;
                    when"001"=>next_state<=m10;
                    when"010"=>next_state<=m15;
                    when"100"=>next_state<=m25;
                    when others=>next_state<=current_state;
                end case;
            when m10=>
                output_ticket<='0';
                return_money<="000";
                case input_money is
                    when"000"=>next_state<=m10;
                    when"001"=>next_state<=m15;
                    when"010"=>next_state<=m20;
                    when"100"=>next_state<=m30;
                    when others=>next_state<=current_state;
                end case; 
            when m15=>
                output_ticket<='0';
                return_money<="000";
                case input_money is
                    when"000"=>next_state<=m15;
                    when"001"=>next_state<=m20;
                    when"010"=>next_state<=m25;
                    when"100"=>next_state<=m35;
                    when others=>next_state<=current_state;
                end case; 
            when m20=>
                output_ticket<='0';
                return_money<="000";
                case input_money is
                    when"000"=>next_state<=m20;
                    when"001"=>next_state<=m25;
                    when"010"=>next_state<=m30;
                    when"100"=>next_state<=m40;
                    when others=>next_state<=current_state;
                end case; 
            when m25=>
                output_ticket<='1';
                return_money<="000";
                case input_money is
                    when"000"=>next_state<=m0;
                    when"001"=>next_state<=m5;
                    when"010"=>next_state<=m10;
                    when"100"=>next_state<=m20;
                    when others=>next_state<=current_state;
                end case; 
            when m30=>
                output_ticket<='1';
                return_money<="001";
                case input_money is
                    when"000"=>next_state<=m0;
                    when"001"=>next_state<=m5;
                    when"010"=>next_state<=m10;
                    when"100"=>next_state<=m20;
                    when others=>next_state<=current_state;
                end case;
             when m35=>
                output_ticket<='1';
                return_money<="010";
                case input_money is
                    when"000"=>next_state<=m0;
                    when"001"=>next_state<=m5;
                    when"010"=>next_state<=m10;
                    when"100"=>next_state<=m20;
                    when others=>next_state<=current_state;
                end case;    
            when m40=>
                output_ticket<='1';
                return_money<="011";
                case input_money is
                    when"000"=>next_state<=m0;
                    when"001"=>next_state<=m5;
                    when"010"=>next_state<=m10;
                    when"100"=>next_state<=m20;
                    when others=>next_state<=current_state;
                end case;    
        end case;             
end process;

end Behavioral;

testbench: 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity ticket_state_machine_tb is
--  Port ( );
end ticket_state_machine_tb;

architecture Behavioral of ticket_state_machine_tb is
component ticket_state_machine
    Port (
        clk,reset:in std_logic;
        input_money:in std_logic_vector(2 downto 0);
        return_money:out std_logic_vector(2 downto 0);
        output_ticket:out std_logic
    );
end component;
signal clk,reset: std_logic;
signal input_money: std_logic_vector(2 downto 0);
signal return_money: std_logic_vector(2 downto 0);
signal output_ticket: std_logic;
begin
tsm:ticket_state_machine port map(clk,reset,input_money,return_money,output_ticket);

clock:process
    begin
        clk<='0';
        wait for 10ns;
        clk<='1';
        wait for 10ns;
end process;

start:process
    begin
        reset<='1';
        wait for 20ns;
        reset<='0';
        wait;
end process;

test:process
    begin
        wait for 50ns;
        input_money<="001";
        wait for 20ns;
        input_money<="000";
        wait for 50ns;
        input_money<="010";
        wait for 20ns;
        input_money<="000";
        wait for 50ns;
        input_money<="100";
        wait for 20ns;
        input_money<="000";
        wait for 50ns;
        input_money<="010";
        wait for 20ns;
        input_money<="000";
end process;

end Behavioral;

4.按键消抖电路设计

请使用硬件描述语言设计一个按键消抖电路,假设输入时钟频率为50MHZ。请给出设计方案及仿真验证结果。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity key_stroke is
    generic(CLK_FRE:integer:=50000000);
    Port (
        clk:in std_logic;
        reset:in std_logic;
        key_in:in std_logic;
        output:out std_logic           
    );
end key_stroke;

architecture Behavioral of key_stroke is

type states is(s0,s1,s2,s3,s4);
signal state:states;

begin
process(reset,clk,key_in)
variable count_num:integer:=3*CLK_FRE/1000;
variable count:integer:=0;
    begin
        if reset='1'then
            state<=s0;
            count:=0;
            output<='0';
        elsif reset='0'then
            case state is
                when s0=>if key_in='1' then state<=s1;end if;
                when s1=>
                    if clk='1' then count:=count+1;end if;
                    if count=count_num then state<=s2; end if;
                when s2=>
                    if(key_in='1')then output<='1';state<=s3;
                    elsif(key_in='0')then output<='0';state<=s4;
                    end if;
                when s3=>
                    output<='0';
                    if(key_in='0')then state<=s4;end if;
                when s4=>
                    state<=s0;
                    count:=0;
                    output<='0';             
            end case;               
        end if;     
end process;



end Behavioral;

testbench: 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity key_stroke_tb is
--  Port ( );
end key_stroke_tb;

architecture Behavioral of key_stroke_tb is
component key_stroke
    generic(CLK_FRE:integer:=50000000);
    port(
        clk:in std_logic;
        reset:in std_logic;
        key_in:in std_logic;
        output:out std_logic 
    ); 
end component;
signal clk:std_logic;
signal reset:std_logic;
signal key_in:std_logic;
signal output:std_logic;
begin
ks:key_stroke generic map(50000000)port map(clk,reset,key_in,output);

clock:process
begin
    clk<='0';
    wait for 10ns;
    clk<='1';
    wait for 10ns;
end process;

rst:process
begin
    reset<='1';
    wait for 25ns;
    reset<='0';
    wait;
end process;

test:process
begin
    key_in<='1';
    wait for 50ns;
    key_in<='0';
    wait for 70ns;
    key_in<='1';
    wait for 100ns;
    key_in<='0';
    wait for 40ns;
    key_in<='1';
    wait for 120ns;
    key_in<='0';
    wait for 30ns;
    key_in<='1';
    wait for 40ns;
    key_in<='0';
    wait for 70ns;
    key_in<='1';
    wait for 30ns;
    key_in<='0';
    wait for 100ns;
    key_in<='1';
    wait for 50ns;
    key_in<='0';
    wait for 20ns;
    key_in<='1';
    wait for 1000ns;
    key_in<='0';
    wait for 2000ns;
end process;

end Behavioral;

5.同步环形FIFO设计

请采用硬件描述语言设计实现一个存储深度M和数据宽度N可以用户配置的同步FIFO存储器,请给出仿真结果。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity FIFO_ring is
generic(
    depth:positive :=8;
    width:positive:=8
);
    Port(
        clk:in std_logic;
        rst:in std_logic;
        data_in:in std_logic_vector(7 downto 0);
        wr:in std_logic;
        rd:in std_logic;
--        wr_clr:in std_logic;
--        wr_en:in std_logic;
--        rd_clr:in std_logic;
--        rd_en:in std_logic;
        
        empty:out std_logic;
        full:out std_logic;
        data_out:out std_logic_vector(7 downto 0)
    );
end FIFO_ring;

architecture Behavioral of FIFO_ring is
component duaram
generic(
    depth:positive :=8;
    width:positive:=8
);
Port(
    clka:in std_logic;
    wr:in std_logic;
    addra:in std_logic_vector(depth-1 downto 0);
    datain:in std_logic_vector(width-1 downto 0);
    
    clkb:in std_logic;
    rd:in std_logic;
    addrb:in std_logic_vector(depth-1 downto 0);
    dataout:out std_logic_vector(width-1 downto 0)
); 
end component;
component write_pointer
    generic(
        depth:positive
    );
    Port(
        clk:in std_logic;
        rst:in std_logic;
        wq:in std_logic;
        wr_pt:out std_logic_vector(depth-1 downto 0)
    );
end component;
component read_pointer
    generic(
        depth:positive
    );
    Port(
        clk:in std_logic;
        rst:in std_logic;
        rq:in std_logic;
        rd_pt:out std_logic_vector(depth-1 downto 0)
    );
end component;
component judge_status
    generic(
        depth:positive
    );
    port(
        clk:in std_logic;
        rst:in std_logic;
        wr_pt:in std_logic_vector(depth-1 downto 0);
        rd_pt:in std_logic_vector(depth-1 downto 0);
        empty:out std_logic;
        full:out std_logic
    );
end component;

signal rp_line:std_logic_vector(depth-1 downto 0);
signal wp_line:std_logic_vector(depth-1 downto 0);

begin
duaram_inst:duaram generic map(depth,width)port map(clka=>clk,clkb=>clk,datain=>data_in,dataout=>data_out,addra=>wp_line,addrb=>rp_line,rd=>rd,wr=>wr);
write_pointer_inst:write_pointer generic map(depth)port map(clk=>clk,rst=>rst,wq=>wr,wr_pt=>wp_line);
read_pointer_inst:read_pointer generic map(depth)port map(clk=>clk,rst=>rst,rq=>rd,rd_pt=>rp_line);
judge_status_inst:judge_status generic map(depth)port map(clk=>clk,rst=>rst,wr_pt=>wp_line,rd_pt=>rp_line,full=>full,empty=>empty);


end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity duaram is
generic(
    depth:positive :=8;
    width:positive:=8
);
Port(
    clka:in std_logic;
    wr:in std_logic;
    addra:in std_logic_vector(depth-1 downto 0);
    datain:in std_logic_vector(width-1 downto 0);
    
    clkb:in std_logic;
    rd:in std_logic;
    addrb:in std_logic_vector(depth-1 downto 0);
    dataout:out std_logic_vector(width-1 downto 0)
);
end duaram;

architecture Behavioral of duaram is

type ram is array(2**depth-1 downto 0)of std_logic_vector(width-1 downto 0);
signal dualram:ram;

begin

process(clka,clkb)
begin
    if(clka'event and clka='1')then
        if(wr='0')then dualram(conv_integer(addra))<=datain;end if;
    end if;
end process;

process(clkb)
begin
    if(clkb'event and clkb='1')then
        if(rd='0')then dataout<=dualram(conv_integer(addrb));end if;
    end if;
end process;

end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity write_pointer is
    generic(
        depth:positive
    );
    Port(
        clk:in std_logic;
        rst:in std_logic;
        wq:in std_logic;
        wr_pt:out std_logic_vector(depth-1 downto 0)
    );
end write_pointer;

architecture Behavioral of write_pointer is

signal wr_pt_t:std_logic_vector(depth-1 downto 0);

begin
process(rst,clk)
begin
    if(rst='0')then
        wr_pt_t<=(others=>'0');
    elsif(clk'event and clk='1')then
        if wq='0'then wr_pt_t<=wr_pt_t+1;end if;
    end if;     
end process;
wr_pt<=wr_pt_t;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity read_pointer is
    generic(
        depth:positive
    );
    Port(
        clk:in std_logic;
        rst:in std_logic;
        rq:in std_logic;
        rd_pt:out std_logic_vector(depth-1 downto 0)
    );
end read_pointer;

architecture Behavioral of read_pointer is

signal rd_pt_t:std_logic_vector(depth-1 downto 0);

begin
process(rst,clk)
begin
    if(rst='0')then
        rd_pt_t<=(others=>'0');
    elsif(clk'event and clk='1')then
        if rq='0'then rd_pt_t<=rd_pt_t+1;end if;
    end if;     
end process;
rd_pt<=rd_pt_t;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity judge_status is
    generic(
        depth:positive
    );
    port(
        clk:in std_logic;
        rst:in std_logic;
        wr_pt:in std_logic_vector(depth-1 downto 0);
        rd_pt:in std_logic_vector(depth-1 downto 0);
        empty:out std_logic;
        full:out std_logic
    );
end entity judge_status;

architecture Behavioral of judge_status is

begin

process(rst,clk)
begin
    if(rst='0')then empty<='1';
    elsif clk'event and clk='1'then
        if wr_pt=rd_pt then empty<='1';
        else empty<='0';
        end if;
    end if;  
end process;

process(rst,clk)
begin
    if(rst='0')then full<='0';
    elsif clk'event and clk='1'then
        if wr_pt>rd_pt then
            if(depth+rd_pt)=wr_pt then full<='1';else full<='0';end if;
        end if;
    end if;  
end process;

end Behavioral;

testbench: 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity FIFO_ring_tb is
--  Port ( );
end FIFO_ring_tb;

architecture Behavioral of FIFO_ring_tb is

component FIFO_ring
generic(
    depth:positive :=8;
    width:positive:=8
);
    Port(
        clk:in std_logic;
        rst:in std_logic;
        data_in:in std_logic_vector(7 downto 0);
        wr:in std_logic;
        rd:in std_logic;
--        wr_clr:in std_logic;
--        wr_en:in std_logic;
--        rd_clr:in std_logic;
--        rd_en:in std_logic;
        
        empty:out std_logic;
        full:out std_logic;
        data_out:out std_logic_vector(7 downto 0)
    );
end component;

signal clk:std_logic;
signal rst:std_logic;
signal data_in:std_logic_vector(7 downto 0);
signal wr:std_logic;
signal rd:std_logic;
signal empty:std_logic;
signal full:std_logic;
signal data_out:std_logic_vector(7 downto 0);

begin

FIFO_ring_inst:FIFO_ring generic map(8,8)port map(clk,rst,data_in,wr,rd,empty,full,data_out);

clock:process
begin
    clk<='0';
    wait for 10ns;
    clk<='1';
    wait for 10ns;
end process;

reset:process
begin
    rst<='0';
    wait for 25ns;
    rst<='1';
    wait;
end process;

test:process
begin
    rd<='1';
    wr<='1';
    data_in<="00000000";
    wait for 50ns;
    data_in<="00000001";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="00000010";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="00000100";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="00001000";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="00010000";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="00100000";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="01000000";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 30ns;
    data_in<="10000000";
    wr<='0';
    wait for 20ns;
    wr<='1';
    wait for 50ns;
    
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    rd<='0';
    wait for 20ns;
    rd<='1';
    wait for 30ns;
    
    wait;
    
end process;

end Behavioral;

6.线上实验——时钟模块设计

采用硬件描述语言设计实现CPU时钟模块,输出信号包括四个节拍信号(每两个时钟周期一个节拍),时钟反相信号,时钟2分频信号及其反相信号,完成逻辑功能设计及仿真验证,并给出仿真结果。

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity clock is
    Port(
        clk,rst:in std_logic;
        clk1,nclk1:out std_logic;   --clk
        clk2,nclk2:out std_logic;   --clk二分频
        w0,w1,w2,w3:out std_logic   --节拍信号
    );
end clock;

architecture Behavioral of clock is
begin

process(clk)
variable count_clk2:integer:=0;
variable count_w:integer:=0;
begin
    if(rst='0')then
        w0<='0';
        w1<='0';
        w2<='0';
        w3<='0';
        clk1<='0';
        nclk1<='1';
        clk2<='0';
        nclk2<='1';
        count_clk2:=0;
        count_w:=0;
    elsif(rst='1')then
        clk1<=clk;
        nclk1<=not clk;
        if(clk'event and clk='1')then
            if(count_clk2=0)then count_clk2:=1;clk2<='1';nclk2<='0';
            elsif(count_clk2=1)then count_clk2:=0;clk2<='0';nclk2<='1';
            end if;
            if(count_w>=0 and count_w<=3)then w0<='1';else w0<='0';end if;
            if(count_w>=4 and count_w<=7)then w1<='1';else w1<='0';end if;
            if(count_w>=8 and count_w<=11)then w2<='1';else w2<='0';end if;
            if(count_w>=12 and count_w<=15)then w3<='1';else w3<='0';end if;
            if(count_w<15)then count_w:=count_w+1;else count_w:=0;end if;
        end if;
    end if;
end process;

end Behavioral;

testbench: 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity clock_tb is
--  Port ( );
end clock_tb;

architecture Behavioral of clock_tb is
component clock
    Port(
        clk,rst:in std_logic;
        clk1,nclk1:out std_logic;   --clk
        clk2,nclk2:out std_logic;   --clk二分频
        w0,w1,w2,w3:out std_logic   --节拍信号
    );
end component;

signal clk,rst:std_logic;
signal clk1,nclk1:std_logic;   --clk
signal clk2,nclk2:std_logic;   --clk二分频
signal w0,w1,w2,w3:std_logic;  --节拍信号

begin
clock_inst:clock port map(clk,rst,clk1,nclk1,clk2,nclk2,w0,w1,w2,w3);

clock_gen:process
begin
    clk<='0';
    wait for 10ns;
    clk<='1';
    wait for 10ns;
end process;

reset_gen:process
begin
    rst<='0';
    wait for 25ns;
    rst<='1';
    wait;
end process;

end Behavioral;

7.线上实验——原码二位乘法器设计 

请用硬件描述语言设计一个原码二位乘法器,其中两个操作数位宽为8,请给出仿真结果。

顶层——multiplier_2bit:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity multiplier_2bit is
    Port(
        clk,start:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        done:out std_logic;
        sout:inout std_logic_vector(15 downto 0)
    );
end multiplier_2bit;

architecture Behavioral of multiplier_2bit is

component multiplier_ctrl
    Port (
        clk,start:in std_logic;
        clkout,rstall,done:out std_logic
     );
end component;
component multiplier_8bitshiftreg
    Port (
        clk,load:in std_logic;
        din:in std_logic_vector(7 downto 0);
        qb0,qb1:out std_logic
     );
end component;
component multiplier_16bitreg
    Port (
        clk,clr:in std_logic;
        d:in std_logic_vector(8 downto 0);
        q:out std_logic_vector(15 downto 0)
     );
end component;
component multiplier_selector
    Port (
        clk,rst:in std_logic;
        a0,a1,cin:in std_logic;
        din:in std_logic_vector(7 downto 0);
        cout:out std_logic;
        dout:out std_logic_vector(7 downto 0)
     );
end component;
component multiplier_8bitadder
    Port (
        clk,rst:in std_logic;
        cin:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        sout:out std_logic_vector(8 downto 0)
     );
end component;

signal clk_line:std_logic;
signal rst_line:std_logic;
signal cin_line:std_logic;
signal qb1_line,qb0_line:std_logic;
signal bin_line:std_logic_vector(7 downto 0);
signal sout_line:std_logic_vector(8 downto 0);
signal test_line:std_logic_vector(8 downto 0);

begin
multiplier_ctrl_inst:multiplier_ctrl port map(clk=>clk,start=>start,clkout=>clk_line,rstall=>rst_line,done=>done);
multiplier_8bitshiftreg_inst:multiplier_8bitshiftreg port map(clk=>clk_line,load=>rst_line,din=>ain,qb0=>qb0_line,qb1=>qb1_line);
multiplier_16bitreg_inst:multiplier_16bitreg port map(clk=>clk_line,clr=>rst_line,d=>sout_line,q=>sout);
multiplier_selector_inst:multiplier_selector port map(clk=>clk_line,rst=>rst_line,a0=>qb0_line,a1=>qb1_line,cin=>sout_line(8),din=>bin,cout=>cin_line,dout=>bin_line);
multiplier_8bitadder_inst:multiplier_8bitadder port map(clk=>clk_line,rst=>rst_line,cin=>cin_line,ain=>sout(15 downto 8),bin=>bin_line,sout=>sout_line);

end Behavioral;

testbench:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity multiplier_2bit_tb is
--  Port ( );
end multiplier_2bit_tb;

architecture Behavioral of multiplier_2bit_tb is
component multiplier_2bit
    Port(
        clk,start:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        done:out std_logic;
        sout:inout std_logic_vector(15 downto 0)
    );
end component;
signal clk,start: std_logic;
signal ain,bin: std_logic_vector(7 downto 0);
signal done: std_logic;
signal sout: std_logic_vector(15 downto 0);
begin
multiplier_2bit_inst:multiplier_2bit port map(clk,start,ain,bin,done,sout);

clock_gen:process
begin  
    clk<='1';
    wait for 10ns;
    clk<='0';
    wait for 10ns;
end process;

test:process
begin
    ain<="10011010";
    bin<="01100101";
    wait for 25ns;
    start<='1';
    wait for 25ns;
    start<='0';    
    wait for 150ns;
end process;

end Behavioral;

模块:

multiplier_2bit_ctrl :

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_ctrl is
    Port (
        clk,start:in std_logic;
        clkout,rstall,done:out std_logic
     );
end multiplier_ctrl;

architecture Behavioral of multiplier_ctrl is

signal cnt3b:std_logic_vector(2 downto 0);

begin

process(clk,start)
begin
    rstall<=start;
    if(start='1')then cnt3b<="000";
    elsif clk'event and clk='1'then if cnt3b<=4 then cnt3b<=cnt3b+1;end if;
    end if;
end process;

process(clk,cnt3b,start)
begin
    if (start='1')then
        clkout<='0';done<='0'; 
    elsif(start='0')then    
        if cnt3b<=4 then clkout<=clk;
        else clkout<='0';done<='1';
        end if; 
    end if;
end process;

end Behavioral;

multiplier_2bit_8bitshiftreg:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_8bitshiftreg is
    Port (
        clk,load:in std_logic;
        din:in std_logic_vector(7 downto 0);
        qb0,qb1:out std_logic
     );
end multiplier_8bitshiftreg;

architecture Behavioral of multiplier_8bitshiftreg is

signal reg8b:std_logic_vector(7 downto 0);

begin

process(clk,load)
begin
    if load='1'then reg8b<=din;qb0<='0';qb1<='0';end if;
    if(load='0'and clk='1')then 
        qb0<=reg8b(0);
        qb1<=reg8b(1);
        reg8b(5 downto 0)<=reg8b(7 downto 2);
        reg8b(7 downto 6)<="00";   
    end if;     
end process;

end Behavioral;

multiplier_2bit_16bitreg:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_16bitreg is
    Port (
        clk,clr:in std_logic;
        d:in std_logic_vector(8 downto 0);
        q:out std_logic_vector(15 downto 0)
     );
end multiplier_16bitreg;

architecture Behavioral of multiplier_16bitreg is

begin

process(clk,clr)
variable sr16b:std_logic_vector(15 downto 0);
begin
    if clr='1'then
        sr16b:="0000000000000000";
    elsif(clr='0'and clk'event and clk='1')then  
        sr16b(15 downto 8):=d(7 downto 0);
        sr16b(13 downto 0):=sr16b(15 downto 2);
        sr16b(15):=d(8);
        sr16b(14):=d(8);
    end if;   
    q<=sr16b;
end process;

end Behavioral;

multiplier_2bit_selector:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_selector is
    Port (
        clk,rst:in std_logic;
        a0,a1,cin:in std_logic;
        din:in std_logic_vector(7 downto 0);
        cout:out std_logic;
        dout:out std_logic_vector(7 downto 0)
     );
end multiplier_selector;

architecture Behavioral of multiplier_selector is

begin

process(clk,a0,a1,cin,din)
begin
    if(rst='1')then cout<='0';dout<="00000000";
    elsif(rst='0'and clk'event and clk='0')then
        if(a0=a1 and a0=cin)then dout<="00000000";cout<=cin;
        elsif(a1='0'and (a0 xor cin)='1')then dout<=din;cout<='0';
        elsif((a1 xor a0)='1'and a0=cin)then
            dout(7 downto 1)<=din(6 downto 0);  
            dout(0)<='0';
            cout<='0';
        elsif(a1='1'and(a0 xor cin)='1')then
            dout<=(not din)+1;
            cout<='1';  
        end if;
    end if;    
end process;

end Behavioral;

multiplier_2bit_8bitadder:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_8bitadder is
    Port (
        clk,rst:in std_logic;
        cin:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        sout:out std_logic_vector(8 downto 0)
     );
end multiplier_8bitadder;

architecture Behavioral of multiplier_8bitadder is
begin

process(clk,rst,ain,bin,cin)
begin
    if(rst='1')then sout<="000000000";
    elsif(rst='0'and clk='0')then
        sout<=('0'& ain)+(cin & bin);
    end if;
end process;

end Behavioral;

设计注意点:

0.设计顺序:控制器-8b移位寄存器-16位缓存器-选择器-加法器

1.输入位8位无符号数,若输入有符号数需修改位宽并另外计算符号位。

2.共用总线需注意时序,防止总线冲突以及数据读取错误

共用总线sout时序设计:

3.process内语句顺序执行的次序。

4.变量的使用:mulitiplier_16bitreg中

variable sr16b:std_logic_vector(15 downto 0);

若使用 signal sr16b,则 q<=sr16b; 无效

5.位拓展:

sout<=('0'& ain)+(cin & bin); 

使用 & 符拓展位宽

8.线上实验——布斯乘法器设计

采用硬件描述语言设计实现布斯乘法器,完成逻辑功能设计及仿真验证,并给出仿真结果。

按照7中的设计顺序对7中设计文件进行修改:

        ctrl模块发出时钟周期数改为8;8bitshiftreg和16bitreg模块每个时钟周期移动1位,且8;8bitshiftreg输出的是a0和a-1;16bitreg和selector模块载入数值后求补;selector模块删去cin和cout信号并修改规则;adder无cin...

顶层模块——multiplier_booth:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity multiplier_booth is
    Port(
        clk,start:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        done:out std_logic;
        sout:inout std_logic_vector(15 downto 0)
    );
end multiplier_booth;

architecture Behavioral of multiplier_booth is

component multiplier_booth_ctrl
    Port (
        clk,start:in std_logic;
        clkout,rstall,done:out std_logic
     );
end component;
component multiplier_booth_8bitshiftreg
    Port (
        clk,load:in std_logic;
        din:in std_logic_vector(7 downto 0);
        qb0,qb1:out std_logic
     );
end component;
component multiplier_booth_16bitreg
    Port (
        clk,clr:in std_logic;
        d:in std_logic_vector(8 downto 0);
        q:out std_logic_vector(15 downto 0)
     );
end component;
component multiplier_booth_selector
    Port (
        clk,rst:in std_logic;
        a0,a1:in std_logic;
        din:in std_logic_vector(7 downto 0);
        dout:out std_logic_vector(7 downto 0)
     );
end component;
component multiplier_booth_8bitadder
    Port (
        clk,rst:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        sout:out std_logic_vector(8 downto 0)
     );
end component;

signal clk_line:std_logic;
signal rst_line:std_logic;
signal qb1_line,qb0_line:std_logic;
signal bin_line:std_logic_vector(7 downto 0);
signal sout_line:std_logic_vector(8 downto 0);
signal test_line:std_logic_vector(8 downto 0);

begin
multiplier_booth_ctrl_inst:multiplier_booth_ctrl port map(clk=>clk,start=>start,clkout=>clk_line,rstall=>rst_line,done=>done);
multiplier_booth_8bitshiftreg_inst:multiplier_booth_8bitshiftreg port map(clk=>clk_line,load=>rst_line,din=>ain,qb0=>qb0_line,qb1=>qb1_line);
multiplier_booth_16bitreg_inst:multiplier_booth_16bitreg port map(clk=>clk_line,clr=>rst_line,d=>sout_line,q=>sout);
multiplier_booth_selector_inst:multiplier_booth_selector port map(clk=>clk_line,rst=>rst_line,a0=>qb0_line,a1=>qb1_line,din=>bin,dout=>bin_line);
multiplier_booth_8bitadder_inst:multiplier_booth_8bitadder port map(clk=>clk_line,rst=>rst_line,ain=>sout(15 downto 8),bin=>bin_line,sout=>sout_line);

end Behavioral;

testbench:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity multiplier_booth_tb is
--  Port ( );
end multiplier_booth_tb;

architecture Behavioral of multiplier_booth_tb is
component multiplier_booth
    Port(
        clk,start:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        done:out std_logic;
        sout:inout std_logic_vector(15 downto 0)
    );
end component;
signal clk,start: std_logic;
signal ain,bin: std_logic_vector(7 downto 0);
signal done: std_logic;
signal sout: std_logic_vector(15 downto 0);
begin
multiplier_booth_inst:multiplier_booth port map(clk,start,ain,bin,done,sout);

clock_gen:process
begin  
    clk<='1';
    wait for 10ns;
    clk<='0';
    wait for 10ns;
end process;

test:process
begin
    ain<="00000010";
    bin<="10000010";
    wait for 25ns;
    start<='1';
    wait for 25ns;
    start<='0';    
    wait for 200ns;
end process;

end Behavioral;

模块:

multiplier_booth_ctrl:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_booth_ctrl is
    Port (
        clk,start:in std_logic;
        clkout,rstall,done:out std_logic
     );
end multiplier_booth_ctrl;

architecture Behavioral of multiplier_booth_ctrl is

signal cnt4b:std_logic_vector(3 downto 0);

begin

process(clk,start)
begin
    rstall<=start;
    if(start='1')then cnt4b<="0000";
    elsif clk'event and clk='1'then if cnt4b<=8 then cnt4b<=cnt4b+1;end if;
    end if;
end process;

process(clk,cnt4b,start)
begin
    if (start='1')then
        clkout<='0';done<='0'; 
    elsif(start='0')then    
        if cnt4b<=8 then clkout<=clk;
        else clkout<='0';done<='1';
        end if; 
    end if;
end process;

end Behavioral;

multiplier_booth_8bitshiftreg:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_booth_8bitshiftreg is
    Port (
        clk,load:in std_logic;
        din:in std_logic_vector(7 downto 0);
        qb0,qb1:out std_logic
     );
end multiplier_booth_8bitshiftreg;

architecture Behavioral of multiplier_booth_8bitshiftreg is

signal reg8b:std_logic_vector(8 downto 0);

begin

process(clk,load)
begin
    if load='1'then 
        if(din(7)='1')then reg8b(8 downto 1)<=(din(7)&(not din(6 downto 0)))+1;else reg8b(8 downto 1)<=din;end if;  --取补码
        reg8b(0)<='0';
        qb0<='0';qb1<='0';
    end if;
    if(load='0'and clk='1')then 
        qb0<=reg8b(0);
        qb1<=reg8b(1);
        reg8b(7 downto 0)<=reg8b(8 downto 1);
        reg8b(8)<='0';   
    end if;     
end process;

end Behavioral;

multiplier_booth_16bitreg:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_booth_16bitreg is
    Port (
        clk,clr:in std_logic;
        d:in std_logic_vector(8 downto 0);
        q:out std_logic_vector(15 downto 0)
     );
end multiplier_booth_16bitreg;

architecture Behavioral of multiplier_booth_16bitreg is

begin

process(clk,clr)
variable sr16b:std_logic_vector(15 downto 0);
begin
    if clr='1'then
        sr16b:="0000000000000000";
    elsif(clr='0'and clk'event and clk='1')then  
        sr16b(15 downto 8):=d(7 downto 0);
        sr16b(14 downto 0):=sr16b(15 downto 1);
        sr16b(15):=d(8);    --移位复制符号位
    end if;   
    q<=sr16b;
end process;

end Behavioral;

multiplier_booth_selector:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_booth_selector is
    Port (
        clk,rst:in std_logic;
        a0,a1:in std_logic;
        din:in std_logic_vector(7 downto 0);
        dout:out std_logic_vector(7 downto 0)
     );
end multiplier_booth_selector;

architecture Behavioral of multiplier_booth_selector is

begin

process(clk,a0,a1,din)
variable complement_x:std_logic_vector(7 downto 0);
variable complement_x_negative:std_logic_vector(7 downto 0);
begin
    if(rst='1')then dout<="00000000";
    elsif(rst='0'and clk'event and clk='0')then
        if(din(7)='1')then complement_x:=(din(7)&(not din(6 downto 0)))+1;else complement_x:=din;end if;    --取X补码
        if((not din(7))='1')then complement_x_negative:=((not din(7))&(not din(6 downto 0)))+1;else complement_x_negative:=(not din(7))&din(6 downto 0);end if; --取-X补码
        if(a1=a0)then dout<="00000000";
        elsif(a0='1'and a1='0')then dout<=complement_x;
        elsif(a0='0'and a1='1')then dout<=complement_x_negative;
        end if;
    end if;    
end process;

end Behavioral;

multiplier_booth_8bitadder:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity multiplier_booth_8bitadder is
    Port (
        clk,rst:in std_logic;
        ain,bin:in std_logic_vector(7 downto 0);
        sout:out std_logic_vector(8 downto 0)
     );
end multiplier_booth_8bitadder;

architecture Behavioral of multiplier_booth_8bitadder is
begin

process(clk,rst,ain,bin)
begin
    if(rst='1')then sout<="000000000";
    elsif(rst='0'and clk='0')then
        sout<=(ain(7) & ain)+(bin(7)  & bin);   --符号位扩展加法
    end if;
end process;

end Behavioral;

设计注意点:

1.求补码的方法:

if(din(7)='1')then 
    reg8b(8 downto 1)<=(din(7)&(not din(6 downto 0)))+1;
else reg8b(8 downto 1)<=din;
end if;  
--取补码

2.求和时符号位拓展:

sout<=(ain(7) & ain)+(bin(7)  & bin);   --符号位扩展加法

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/513300.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

基于JSPM的宜佰丰超市进销存管理系统

目录 背景 技术简介 系统简介 界面预览 背景 互联网的迅猛发展彻底转变了全球众多组织的管理策略。自20世纪90年代起&#xff0c;中国政府和各类企事业单位便开始探索利用互联网技术进行信息管理。然而&#xff0c;由于当时网络覆盖不广泛、用户接受度不高、互联网相关法律…

苹果IPA上传错误排查:常见问题解决方案汇总

目录 引言 摘要 第二步&#xff1a;打开appuploader工具 第二步&#xff1a;打开appuploader工具&#xff0c;第二步&#xff1a;打开appuploader工具 第五步&#xff1a;交付应用程序&#xff0c;在iTunes Connect中查看应用程序 总结 引言 在将应用程序上架到苹果应用商…

旧衣回收小程序开发,回收市场的发展趋势

一、回收背景 每年到换季时期&#xff0c;就会产生大量的废弃衣物。随着人们生活水平的提高&#xff0c;闲置旧衣服逐年增加&#xff0c;面对满满当当的衣柜&#xff0c;大众也只能进行丢弃&#xff0c;但这也造成了损失&#xff0c;同时也造成了较大的资源浪费。 其实&#…

【leetcode】双指针(二)

标题&#xff1a; 【leetcode】双指针&#xff08;二&#xff09; 水墨不写bug 正文开始&#xff1a; &#xff08;一&#xff09;总和为目标值的两个数 购物车内的商品价格按照升序记录于数组 price。请在购物车中找到两个商品的价格总和刚好是 target。若存在多种情况&#…

kettle使用MD5加密增量获取接口数据

kettle使用MD5加密增量获取接口数据 场景介绍&#xff1a; 使用JavaScript组件进行MD5加密得到Http header&#xff0c;调用API接口增量获取接口数据&#xff0c;使用json input组件解析数据入库 案例适用范围&#xff1a; MD5加密可参考、增量过程可参考、调用API接口获取…

【TI毫米波雷达】IWR6843AOP的官方文件资源名称BUG,选择xwr68xx还是xwr64xx,及需要注意的问题

【TI毫米波雷达】IWR6843AOP的官方文件资源名称BUG&#xff0c;选择xwr68xx还是xwr64xx&#xff0c;及需要注意的问题 文章目录 demo工程out_of_box文件调试bin文件名称需要注意的问题附录&#xff1a;结构框架雷达基本原理叙述雷达天线排列位置芯片框架Demo工程功能CCS工程导…

这里有份百度Create大会超长剧透,请查收!

作者简介&#xff1a; 辭七七&#xff0c;目前大二&#xff0c;正在学习C/C&#xff0c;Java&#xff0c;Python等 作者主页&#xff1a; 七七的个人主页 文章收录专栏&#xff1a; 七七的闲谈 欢迎大家点赞 &#x1f44d; 收藏 ⭐ 加关注哦&#xff01;&#x1f496;&#x1f…

19c使用Datapump做数据迁移

环境&#xff1a; 源库目标库IP192.168.37.200192.168.37.201系统版本RedHat 7.9RedHat 7.9数据库版本19.3.0.0.019.3.0.0.0SIDbegtarhostnamebegtar数据量412KB 详细说明&#xff1a;因为只是做练习&#xff0c;这里采用了两个单例19c作为源端和目的端服务器&#xff0c;环境…

【网站项目】面向学生成绩分析系统

&#x1f64a;作者简介&#xff1a;拥有多年开发工作经验&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。&#x1f339;赠送计算机毕业设计600个选题excel文件&#xff0c;帮助大学选题。赠送开题报告模板&#xff…

技术揭秘:如何打造完美互动的充电桩硬件与服务平台?

充电桩平台全套源码地址 https://gitee.com/chouleng/cdzkjjh.git 这张图像是一个系统或服务的架构图。以下是对图中各个部分的描述&#xff1a; 前端&#xff1a; 位于图像的顶部&#xff0c;颜色为浅绿色。用户服务端&#xff1a; 紧邻前端&#xff0c;颜色为淡黄色。设备服…

基于java+SpringBoot+Vue的校园交友网站设计与实现

基于javaSpringBootVue的校园交友网站设计与实现 开发语言: Java 数据库: MySQL技术: SpringBoot MyBatis工具: IDEA/Eclipse、Navicat、Maven 系统展示 前台展示 后台展示 系统简介 整体功能包含&#xff1a; 校园交友网站是一个为在校师生提供一个交流互动、寻找朋友的…

CSS3 实现文本与图片横向无限滚动动画

文章目录 1. 实现效果2.html结构3. css代码 1. 实现效果 gif录屏比较卡&#xff0c;实际很湿滑&#xff0c;因为是css动画实现的 2.html结构 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"…

[蓝桥杯练习题]出差

一道DJ题,重要的是隔离时间,把隔离时间加在边权上即可 现实生活的题大多都是无向图建图,需要边的两端点各自上邻接表和相同权重 #include<bits/stdc.h> using namespace std; #define ll long long const int N1005; const int M10005; struct edge{int to;ll w;edge(int…

招聘信息分享(第一期)

今天给大家带来——测绘、地信、遥感领域的事业单位招聘信息&#xff01;这也是我自己在关注的&#xff0c;自己应聘单位大多时间已经截至&#xff0c;后期会陆续分享&#xff0c;先分享近期招聘的事业单位 文章目录 1、宁夏大学2024年人才招聘2、甘肃有色冶金职业技术学院3、…

【大模型】大模型 CPU 推理之 llama.cpp

【大模型】大模型 CPU 推理之 llama.cpp llama.cpp安装llama.cppMemory/Disk RequirementsQuantization测试推理下载模型测试 参考 llama.cpp 描述 The main goal of llama.cpp is to enable LLM inference with minimal setup and state-of-the-art performance on a wide var…

数据分析之POWER BI Desktop可视化应用案列

在power bi中导入数据 导入前期建好的模型 简单介绍&#xff08;power bi desktop&#xff09; 将右边字段全部展开 各类数据 所作的模型 在excel中是单向的&#xff0c;power bi 中可以是双向的 右键单击----点击属性 选择两个---在两个方向上应用安全筛选器 变为双向的…

域名HTTPS证书免费获取渠道

SSL证书的优势 数据加密&#xff1a;SSL证书通过SSL/TLS协议为网站与用户之间的数据传输提供加密保护。这意味着所有在浏览器和服务器之间交换的信息&#xff08;如登录凭据、个人数据、支付详情等&#xff09;都经过加密处理&#xff0c;即使被第三方截获&#xff0c;也无法解…

提效提速的快捷回复工具

在数字化交流日益增长的今天&#xff0c;客服工作显得尤为重要。为了提升对话质量和回复速度&#xff0c;同时减少重复劳动&#xff0c;我同事给我介绍了一款快捷回复工具&#xff0c;叫做客服宝聊天助手。我用了几天真心觉得好好用&#xff0c;今天特地分享这个软件给你们&…

台湾花莲地震已致4死97伤,地震时刻,你需要知道的一切

近日&#xff0c;台湾花莲县海域发生了一次强震&#xff0c;引发了广泛关注。据中国地震台网测定&#xff0c;这次地震的震级高达7.3级&#xff0c;震源深度为12公里&#xff0c;造成了台湾全岛范围内的震感&#xff0c;以及福建、广东等地的明显震感。在这样的紧急情况下&…

防火墙状态检测和会话机制

FW对TCP&#xff0c;UDP和ICMP协议的报文创建会话