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

Introduction to computing laboratory manual

19 0 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đ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

Thông tin cơ bản

Tiêu đề Introduction To Computing Laboratory Manual
Tác giả Nguyộn Thai Binh Duong
Trường học Viet Nam National University Ho Chi Minh City - University Of Technology
Chuyên ngành Electrical And Electronics Engineering
Thể loại Laboratory Manual
Năm xuất bản 2022
Thành phố Ho Chi Minh City
Định dạng
Số trang 19
Dung lượng 3,73 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Lab 4: Implementation of combinational circuit and sequential circuit on FF > Students write the SystemVerilog code to perform the function's circuit as instructed from Prelab with the p

Trang 1

VIET NAM NATIONAL UNIVERSITY HO CHI MINH CITY - UNIVERSITY OF TECHNOLOGY

FACULTY OF ELECTRICAL AND ELECTRONICS ENGINEERING

DEPARTMENT OF ELECTRONICS

0o00—

ạ c›

INTRODUCTION TO COMPUTING LABORATORY MANUAL

Trang 2

gà Lab 4: Implementation of combinational circuit and sequential circuit on FF

<3

LAB 4: IMPLEMENTATION OF BASIC

COMBINATIONAL AND SEQUENTIAL

LOGIC CIRCUITS ON FPGA

Ho va tộn: Nguyộn Thai Binh Duong Lớp TN: TT05

MSSV: 2051103 Ngay: 15/11/2022

Work: 100%

A LAB MANUAL

OBJECTIVES

- Understand how to use FPGA kits, programming software

- Understand how to design a basic combinational and sequential logic circuits on FPGA

- Understand the process of describing hardware on FPGAs

Il PREPARATION:

- Toprepare well forthe test, students MUST read Appendix 1 first and complete the steps

of Sample lab in Appendix 2, and submit it with Prelab 4 before entering class

- Students must complete and submit Prelab 4 before entering class

- Students read the appendix and the Kit DE2 Manual to understand how to use the DE2 Kit, wiring, peripherals, and how to use Q uartus software to simulate and synthesize circuits Students refer to the documentation to understand how to write hardware designs in the SystemVerilog language

lII LAB INSTRUCTIONS

EXPERIMENT 1

Objective: Design the combinational circuit that calculates the absolute value of a 4-bit number (the input is A; the output is S)

đằ Students draw the logic gate diagram of the circuit to be designed

@ Electronics Department

72

Ho Chi Minh City University of Technology, Vietne

Trang 3

Lab 4: Implementation of combinational circuit and sequential circuit on FF

> Students write the SystemVerilog code to perform the function's circuit as instructed

from Prelab with the pin assignment as follows:

o Pins A[3:0] assigned to SW [3:0]

o Pins S$ [8:0] assigned to LEDR [8:0]

Tee er 0|

@ Electronics Department

Ho Chi Minh City University of Technology, Vietne 73

Trang 4

@

gà Lab 4: Implementation of combinational circuit and sequential circuit on FF

c›

> Students compile the above program Then, students simulate the output waveform in all cases of the input Capture the output waveform

(Insert a photo demonstrating that the student has simulated the circuit)

Electronics Department

Ho Chi Minh City University of Technology, Vietne 74

Trang 5

gà Lab 4: Implementation of combinational circuit and sequential circuit on FF

c›

> Students view the results (To@l Netlist Viewer@ RTL Viewer) of the circuit

Decoder1

Als (3 0]

DECODER

DecoderO 15 0

DECODER

>» Students download the code to the DE2 Kit

(Insert a photo proving that the student has uploaded the Kit)

=

terre

me DET - 06

` _ mm

II đo | |

@ Electronics Department

Ho Chi Minh City University of Technology, Vietne 75

Trang 6

Lab 4: Implementation of combinational circuit and sequential circuit on FF

EXPERIMENT 2

Objective: Design the combinational circuit that implements the ALU

The ALU calculates two 4-bit numbers (the two inputs are A and B respectively, the output is

S, the flags are Ci and Co) through the 2-bit input: Sel

- If Sel=00: S=A+B

- If Sel=01: S=A-B

- lf Sel=10: S=A AND B

- lf Sel=11: S=AOR B

Students write the SystemVerilog code to perform the function's circuit as instructed from Prelab with the pin assignment as follows:

©

©

øi@DESKTOP-BVE3LRI: ~ /lab04/ex02

Pins A [3:0] assigned to SW [3:0]

Pins B [3:0] assigned to SW [7:4]

Pins Ci assigned to SW [8]

Pins S [3:0] assigned to LEDR [3:0]

Pins Go assigned to LEDR [4]

Electronics Department

Ho Chi Minh City University of Technology, Vietne 76

Trang 7

@

Lab 4: Implementation of combinational circuit and sequential circuit on FF

> Students compile the above program Then, students simulate the output waveform in all cases of the input Capture the output waveform

(Insert a photo demonstrating that the student has simulated the circuit)

G Sirmstaton Yrave torn Echt - [end 2 se aooat.imas]

> Students view the results (Togl Netlist Viewer@ RTL Viewer) of the circuit

ex02:ex02_wrapper_dut

¬L_@œEDr‹(4 0)

Electronics Department

Ho Chi Minh City University of Technology, Vietne 77

Trang 8

Lab 4: Implementation of combinational circuit and sequential circuit on FF

Mux3

#‡ñ9 —IECc[!.r]

Electronics Department

Ho Chi Minh City University of Technology, Vietne 78

Trang 9

Lab 4: Implementation of combinational circuit and sequential circuit on FF

c2

» Students download the code to the DE2 Kit

(Insert a photo proving that the student has uploaded the Kit)

@ Electronics Department

Ho Chi Minh City University of Technology, Vietne 79

Trang 10

Lab 4: Implementation of combinational circuit and sequential circuit on FF

EXPERIMENT 3

Objective: Design a 3-bit down counter circuit

The count value changes every 1s The output is connected to a common anode 7-segment LED

In addition, the counter has an RST pin (active high) used to reset the counter state to 0 Hint:

- The clock signal is generated from the frequency divider from 50MHz to 1Hz

- Students use the 7-segment LED decoder module in PRELAB, connecting the output of the counter to the input of the module

ằ Students draw the logic gate diagram of the circuit to be designed

đằ Students write the SystemVerilog code to perform the function's circuit as instructed from Prelab with the pin assignment as follows:

o 7-segment LED ouput assigned to HEX [0]

o Pins RST assigned to SW [0]

> Students compile the above program Then, students simulate the output waveform in all cases of the input Capture the output waveform

(Insert a photo demonstrating that the student has simulated the circuit)

[ops s200re znnm oan 12s 16us 192us 2246 25203 209us 322.8 35203 38403 4dộu3 448u9 481s 512M S4gus 5766 683 64us 672L 7.0418 73905 7680u5 80,3

> Students view the results (To@l Netlist Viewer@ RTL Viewer) of the circuit

—E=>LEDR[0 0]

GS Electronics Department

Ho Chi Minh City University of Technology, Vietne 80

Trang 11

Lab 4: Implementation of combinational circuit and sequential circuit on FF

Electronics Department

Ho Chi Minh City University of Technology, Vietne 81

Trang 12

Lab 4: Implementation of combinational circuit and sequential circuit on FF

Electronics Department

Ho Chi Minh City University of Technology, Vietne 82

Trang 13

Lab 4: Implementation of combinational circuit and sequential circuit on FF

» Students download the code to the DE2 Kit

(Insert a photo proving that the student has uploaded the Kit)

EXPERIMENT 4

Objective: Design a 4-bit up counter circuit from 5 to 14

The count value changes every 1s The output is connected to a common anode 7-segment LED

In addition, the counter has an RST pin (active high) used to reset the counter state to 0 Hint:

- The clock signal is generated from the frequency divider from 50MHz to 1Hz

- Students use the 7-segment LED decoder module in PRELAB, connecting the output

of the counter to the input of the module

Electronics Department

Ho Chi Minh City University of Technology, Vietne 83

Trang 14

Lab 4: Implementation of combinational circuit and sequential circuit on FF

- Students need to write a 4-bit binary to BCD converter module

» Students draw the logic gate diagram of the circuit to be designed

» Students write the SystemVerilog code to perform the function's circuit as instructed from Prelab with the pin assignment as follows:

o Two7-segment LED outputs assigned to HEX [1], HEX [0]

o Pins RST assigned to SW [0]

Electronics Department

Ho Chi Minh City University of Technology, Vietne 84

Trang 15

Lab 4: Implementation of combinational circuit and sequential circuit on FF

Electronics Department

Ho Chi Minh City University of Technology, Vietne 85

Trang 16

Lab 4: Implementation of combinational circuit and sequential circuit on FF

Electronics Department

Ho Chi Minh City University of Technology, Vietne 86

Trang 17

Lab 4: Implementation of combinational circuit and sequential circuit on FF

Electronics Department

Ho Chi Minh City University of Technology, Vietne 87

Trang 18

Appendix 2: Sample la

> Students compile the above program Then, students simulate the output waveform in all cases of the input Capture the output waveform

(Insert a photo demonstrating that the student has simulated the circuit)

> Students view the results (To@l Netlist Viewer@ RTL Viewer) of the circuit

Electronics Department

Ho Chi Minh City University of Technology, Vietne 88

Trang 19

Appendix 2: Sample la

>» Students download the code to the DE2 Kit

(Insert a photo proving that the student has uploaded the Kit)

Electronics Department

Ho Chi Minh City University of Technology, Vietne 89

Ngày đăng: 19/12/2024, 13:59