1. Trang chủ
  2. » Luận Văn - Báo Cáo

Báo Cáo Thực Hành Verilog HDL

105 11 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Full Code Verilog LABORATORY EXERCISE 1 8, part 1 8,The DE2 board provides 18 toggle switches, called SW17−0, that can be used as inputs to a circuit, and 18 redlights, called LEDR17−0, that can be used to display output values. Figure 1 shows a simple Verilog module thatuses these switches and shows their states on the LEDs. Since there are 18 switches and lights it is convenient torepresent them as vectors in the Verilog code, as shown. We have used a single assignment statement for all 18LEDR outputs, which is equivalent to the individual assignments

TRƯỜNG ĐẠI HỌC KHOA HỌC KHOA ĐIỆN, ĐIỆN TỬ VÀ CÔNG NGHỆ VẬT LIỆU HỌ VÀ TÊN: PHẠM NGỌC DŨNG MÃ SINH VIÊN: 19T1051030 BÁO CÁO THỰC HÀNH VERILOG TÊN HỌC PHẦN: THỰC HÀNH CHUYÊN NGÀNH KỸ THUẬT ĐIỆN TỬ I – NHÓM MÃ HỌC PHẦN: DTV4313.001 GIẢNG VIÊN HƯỚNG DẪN: PHAN HẢI PHONG HUẾ, THÁNG NĂM 2023 MỤC LỤC LABORATORY EXERCISE Part Part Part Part Part Part LABORATORY EXERCISE 12 Part 12 Part 13 Part 15 Part 16 Part 19 Part 22 Part 24 LABORATORY EXERCISE 27 Part 27 Part 29 Part 30 Part 31 Part 33 LABORATORY EXERCISE 35 Part 35 Part 37 Part 39 Part 40 Part 42 LABORATORY EXERCISE 45 Part 45 Part 47 Part 50 LABORATORY EXERCISE 54 Part 54 Part 56 Part 59 Part 62 Part 64 Part 67 Part 71 Part 72 Part 76 LABORATORY EXERCISE 81 Part 81 Part 83 Part 85 Part 87 Part 90 Part 93 Part 96 LABORATORY EXERCISE 97 Part 97 Part 98 Part 101 Part 103 Part 103 Part 103 Part 103 LABORATORY EXERCISE 104 Part 104 Part 104 Part 104 LABORATORY EXERCISE 10 104 Part 104 Part 104 LABORATORY EXERCISE Switches, Lights, and Multiplexers Part a Yêu cầu: - Kết nối công tắc với led màu đỏ b Kết nối: - Input: SW17-0 - Output: LEDR17-0 c Code Verilog: module part1( input [17:0] SW, output [17:0] LEDR); assign LEDR = SW; endmodule Part a Yêu cầu: - Thiết kế ghép kênh 2-to-1 rộng tám bit, S dùng để chọn đầu vào X Y b Kết nối: - Input: SW17, SW15-8, SW7-0 - Output: LEDR15-8, LEDG7-0 c Code Verilog: module part2 ( input [17:0] SW, output [17:0] LEDR); wire [7:0] LEDG; assign LEDR = SW; //Connected mux (SW[7:0], SW[15:8], SW[17], LEDG); endmodule //Multiplexer to 1============================================ module mux ( input [7:0] X, Y, input S, output [7:0] M); assign M = (S==1'b1) ? X : Y; endmodule Part a Yêu cầu: - Thiết kế ghép kênh to rộng 3-bit Đầu vào S chọn đầu vào U đến Y b Kết nối: - Input: SW17-15, SW14-0 - Output: LEDR17-0, LEDG2-0 c Code Verilog module part3( input [17:0] SW, output [17:0] LEDR, output [7:0] LEDG); assign LEDR = SW; //Connected mux_3 (SW[17:15], SW[14:12], SW[11:9], SW[8:6], SW[5:3], SW[2:0], LEDG[2:0]); endmodule //Multiplexer bit to 1======================================= module mux_3 ( input [2:0] S, U, V, W, X, Y, output reg [2:0] M); always @ (*) case (S) 3'b000: 3'b001: 3'b010: 3'b011: 3'b1xx: endcase endmodule M M M M M

Ngày đăng: 31/03/2023, 09:43

Xem thêm:

w