1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Research the fir filter and implement it on the fpga de1 board

58 0 0
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 đề Research The Fir Filter And Implement It On The Fpga De1 Board
Tác giả Nguyen Hong Dang, Huynh Ngoc Khanh
Người hướng dẫn Me. Nguyen Ngo Lam
Trường học Ho Chi Minh City University of Technology and Education
Chuyên ngành Computer Engineering Technology
Thể loại Graduation Project
Năm xuất bản 2024
Thành phố Ho Chi Minh City
Định dạng
Số trang 58
Dung lượng 6,46 MB

Cấu trúc

  • CHАPTER 1: INTRODUCTION (15)
    • 1.1 OVERVIEW (15)
    • 1.2 OBJECTIVES (16)
    • 1.3 RESEARCH SITUATION (17)
    • 1.4 SUBJECTS АND SCOPE OF RESEАRCH (17)
    • 1.5 REPORT’S LАYOUT (19)
  • CHАPTER 2: THEORETICАL BАSIS (20)
    • 2.1 INTRODUCTION THE PROBLEM (20)
    • 2.2 INTRODUCTION OF FIR FILTER (21)
      • 2.2.1 Concept and Basic Characteristics (21)
      • 2.2.2 Structure and Operational Principles (21)
      • 2.2.3 Design Methods and Advantages (22)
      • 2.2.4 Applications and Future Outlook (22)
    • 2.3 THEORETICAL BACKGROUND (22)
      • 2.3.1 Understanding FIR Filters (22)
      • 2.3.2 FIR filter for audio signals bases on FPGA (23)
  • CHАPTER 3: Implement FIR lowpass filter on DE1kit (26)
    • 3.1. DESIGN SPECIFICATIONS AND IMPLEMENTATION (26)
    • 3.2. CODEC INITIALIZATION (26)
    • 3.3. S2P ADAPTER BLOCK (28)
    • 3.4. FIR FILTER BLOCK (31)
    • 3.5. MАIN АLGORITHMS (32)
      • 3.5.1. Flowchart of Clock divider (32)
      • 3.5.2. Flowchart of CODEC initialization (35)
  • CHАPTER 4 THE RESULTS (41)
    • 4.1. SIMULATION RESULTS .............................................................. xxxix 4.2 HARDWARE RESULTS ........................................................................ xlv CHAPTER 5: CONCLUSION AND FUTURE WORK .................................. li (41)

Nội dung

Leveraging FPGA technology for FIR filter implementation on the DE1 board provides a platform for real-time signal processing with enhanced flexibility and efficiency.. Through meticulou

INTRODUCTION

OVERVIEW

Finite Impulse Response (FIR) filters play a crucial role in digital signal processing, enabling precise adjustments to signal characteristics like frequency response and noise reduction The incorporation of FIR filter design into Field-Programmable Gate Arrays (FPGAs) has opened up new applications and expanded their capabilities significantly This essay aimed to provide an extensive overview of FIR filter research and their implementation on the FPGA DE1 board, blending theoretical insights with practical examples.

A finite impulse response (FIR) filter relies solely on a limited sequence of previous samples to determine its output The behavior and frequency response of FIR filters are shaped by their filter coefficients Various design methods, including windowing, frequency sampling, and optimization techniques like the Parks-McClellan algorithm, can be employed to develop tailored FIR filters for specific applications.

Field-Programmable Gate Arrays (FPGAs) serve as a versatile hardware platform for prototyping and executing digital signal processing algorithms, particularly FIR filters To implement these filters on FPGAs, developers must convert the filter algorithms into a hardware description language like Verilog or VHDL A widely used option for FIR filter implementation is the DE1 board, built on the Altera Cyclone II FPGA, which offers an optimal balance between computational capability and resource availability.

Implementing FIR filters on the DE1 board follows a structured process that includes design, simulation, synthesis, and programming Designers begin by defining the filter architecture and determining the necessary coefficients Simulation tools like Model-Sim are then used to evaluate the filter’s functionality and performance Finally, Quartus Prime's synthesis tool generates hardware description files, which are essential for programming the FPGA on the DE1 board.

The performance evaluation of FPGA-based FIR filters encompasses key metrics such as filtering effectiveness, throughput, resource utilization, and power consumption To assess the effectiveness of these implemented filters, a comparative analysis with theoretical models and simulation results is conducted Furthermore, ongoing research efforts focus on optimizing FIR filter designs to improve resource utilization and overall performance.

The integration of FIR filter design with FPGA technology offers exceptional opportunities for enhancing digital signal processing capabilities Precise implementation on platforms like the DE1 board allows engineers and researchers to address various signal processing challenges with agility and accuracy Ongoing research in this area suggests that combining theoretical insights with practical applications will significantly transform the digital signal processing landscape, leading to innovative applications across multiple domains.

OBJECTIVES

This essay explores the primary objectives guiding research on the implementation of FIR filters on the DE1 FPGA board, emphasizing their crucial role in digital signal processing by enhancing signal feature control with high precision The implementation of FIR filters using FPGA technology represents a promising research avenue for real-time digital signal processing applications Additionally, this essay outlines the challenges, opportunities, and potential impacts associated with deploying FIR filters on FPGA platforms, specifically focusing on the DE1 board.

Explore various FIR filter design methodologies, including windowing, frequency sampling, and optimization algorithms like Parks-McClellan Assess the advantages and limitations of each technique regarding filter performance, complexity, and resource utilization Determine the most appropriate design approach tailored to the needs of real-time signal processing applications.

Optimize FPGA implementations of FIR filters by exploring strategies that enhance resource utilization and reduce area overhead Focus on techniques that decrease hardware complexity while ensuring optimal filter performance and throughput Assess the trade-offs between resource utilization, filter accuracy, and power consumption in the design of FPGA-based FIR filters for improved efficiency.

To ensure the effectiveness of FPGA-implemented FIR filters, it is essential to validate their performance through comprehensive simulation models and real-world experimentation By utilizing benchmark signals, one can assess the filters' capabilities in noise reduction, frequency shaping, and signal enhancement Comparing simulation results with experimental data will further confirm the accuracy and reliability of these FPGA-based FIR filter implementations, ultimately enhancing their performance in practical applications.

Discover the diverse applications of FPGA-based FIR filters in real-time signal processing, including audio processing, image filtering, communication systems, and biomedical signal analysis Assess the effectiveness of FIR filters for tasks demanding low latency and high throughput Additionally, examine the scalability of FPGA implementations to manage large-scale signal processing challenges in resource-constrained settings.

To enhance accessibility and reproducibility in research, we propose the development of open-source FPGA implementations of FIR filters, accompanied by thorough documentation By creating repositories for FPGA-based FIR filter designs, simulation models, and experimental datasets, we aim to promote collaboration and knowledge sharing within the research community Additionally, we encourage the adoption of standardized design methodologies and best practices to ensure consistency and reliability in FPGA implementations of FIR filters.

RESEARCH SITUATION

- Run simulation on development environment

- Build and deploy the system on production environment.

SUBJECTS АND SCOPE OF RESEАRCH

This essay explores the current research landscape of implementing Finite Impulse Response (FIR) filters on the FPGA DE1 board, emphasizing their crucial role in digital signal processing for noise reduction, frequency shaping, and signal enhancement The integration of FPGA technology for FIR filter applications offers promising opportunities for real-time signal processing The discussion highlights recent advancements, ongoing challenges, and emerging trends in FIR filter implementation on FPGA platforms, particularly the DE1 board.

Important points about the research situation of "FIR Filters on the FPGA DE1 Board" include:

Recent advancements in FIR filter design methodologies have focused on optimizing performance, complexity, and resource utilization Innovative approaches, including genetic algorithms and machine learning techniques, are being explored to automate the design and optimization of FIR filters for FPGA implementation Additionally, researchers are investigating adaptive FIR filter designs that can dynamically adjust coefficients in response to varying signal conditions, enhancing adaptability and performance for real-time applications.

FPGA technology provides exceptional flexibility and scalability for digital signal processing algorithms; however, it faces challenges such as resource constraints, power consumption, and design complexity Recent research has introduced innovative solutions, including resource-efficient filter architectures, low-power optimization techniques, and high-level synthesis tools that facilitate rapid FPGA prototyping Collaborative efforts between academia and industry have led to the creation of FPGA-based design frameworks and libraries specifically for FIR filter implementation, which streamline the design process and enhance time-to-market for FPGA-based signal processing solutions.

FPGA-based FIR filters are driving significant advancements across various real-world applications, showcasing their versatility in fields such as wireless communications, medical imaging, radar signal processing, and audio processing Case studies demonstrate the effectiveness of these filters, while ongoing research explores innovative use cases in edge computing, Internet of Things (IoT) devices, and autonomous systems This highlights the transformative potential of FPGA technology in today's digital transformation landscape.

Emerging trends in FIR filter implementation on FPGA platforms highlight the convergence of heterogeneous computing architectures, utilizing the combined strengths of FPGAs, GPUs, and specialized accelerators Key research directions focus on hybrid FPGA-GPU architectures for enhanced FIR filter computations, the application of deep learning for automated FPGA design optimization, and the advancement of hardware-software co-design methodologies for comprehensive system optimization Additionally, interdisciplinary collaborations among researchers in computer science, electrical engineering, and applied mathematics are driving innovation at the intersection of FPGA technology and digital signal processing, creating a dynamic research ecosystem ripe for ongoing growth and discovery.

The research landscape for implementing FIR filters on the FPGA DE1 board is marked by a dynamic interaction of advancements and challenges As researchers explore the potential of FPGA-based signal processing, they are embracing emerging technologies and innovative methodologies By approaching this evolving field with creativity and diligence, researchers can uncover new opportunities in real-time signal processing, fostering innovation and making significant impacts across various domains.

REPORT’S LАYOUT

Our capstone project report will consist of 5 chapters:

Chapter 1 provides a comprehensive overview of the topic, highlighting its significance and urgency in today's context It discusses the development and practical application of FIR filters, emphasizing their relevance in various fields This section articulates the rationale behind selecting this topic and outlines the research goals, subjects, and scope, setting the foundation for a deeper exploration of FIR filter technology.

- Chapter 2: Theoretical basis Presents an overview of the theory and operating principles of the sensors and modules used Introducing the languages and technologies applied in the topic

Chapter 3 focuses on system design, presenting a comprehensive block diagram and necessary calculations while selecting appropriate components for the hardware's main diagram It details the design and operational framework of the FIR filter, leading to the programming and assembly of the overall system This process involves constructing a multi-component system that integrates submodules into a cohesive top module.

- Chapter 4: The Results of system Present the results obtаined аfter completing the system construction

In Chapter 5, the group draws conclusions based on the objectives set in Chapter 1, reflecting on the findings from Chapter 4 They also propose potential areas for improvement and future developments to enhance the topic's practical application and broaden its use in real-world scenarios.

THEORETICАL BАSIS

INTRODUCTION THE PROBLEM

This essay explores the theoretical foundations and practical implementation of Finite Impulse Response (FIR) filters on the FPGA DE1 board, highlighting their essential role in digital signal processing FIR filters provide precise control over signal characteristics, enabling applications such as noise reduction and frequency shaping Implementing FIR filters on the DE1 board leverages FPGA technology for real-time signal processing, enhancing efficiency and versatility By examining FIR filter theory and FPGA techniques, this essay aims to connect theoretical understanding with practical application, illuminating the relationship between theory and practice in FIR filter research and implementation.

FIR filters, known for their finite impulse response, provide an effective method for signal processing The filter's behavior and frequency response are dictated by its finite sequence of coefficients, which define the impulse response Essential design elements, including filter order, cutoff frequency, transition bandwidth, and filter type, shape the performance and capabilities of FIR filters.

Design methodologies for specifying FIR filter coefficients include various techniques to achieve desired frequency responses Windowing methods like Hamming and Kaiser windows enable intuitive FIR filter design with specific passband and stopband characteristics Frequency sampling methods allow for direct control over the filter's frequency response by defining magnitude and phase at discrete points Additionally, optimization algorithms, such as the Parks-McClellan algorithm, help create FIR filters with optimal frequency response properties, minimizing ripple while adhering to strict design specifications.

FPGA technology is ideal for implementing FIR filters due to its reconfigurability, parallelism, and real-time processing capabilities The DE1 board, equipped with an Altera Cyclone II FPGA, is a strong choice for signal processing applications Implementing FIR filters on this board involves converting filter algorithms into hardware description language (HDL) code, such as Verilog or VHDL, and synthesizing this code to create hardware configuration files Key considerations, including resource utilization, clock frequency, and input/output interfaces, are carefully managed to optimize FPGA resource use and ensure real-time performance.

FPGA implementation of FIR filters faces challenges such as resource constraints, timing closure, and power consumption To overcome these issues, advanced techniques like pipelining, parallel processing, and resource sharing are employed, significantly improving performance and efficiency Additionally, high-level synthesis tools and design automation streamline the FPGA development process, facilitating rapid prototyping and deployment of FIR filter implementations on the DE1 board.

The synthesis of FIR filter theory and FPGA implementation on the DE1 board exemplifies the integration of theory and practice in digital signal processing By leveraging the connection between theoretical knowledge and practical application, researchers and engineers advance real-time signal processing, fostering innovation across various fields This transition from theory to practice highlights the significant impact of FIR filter research on FPGA platforms, leading to new applications and discoveries in the evolving realm of digital signal processing.

INTRODUCTION OF FIR FILTER

The Finite Impulse Response (FIR) filter is fundamental in digital signal processing, especially in audio, image processing, and communication systems Unlike Infinite Impulse Response (IIR) filters, FIR filters do not utilize feedback from previous outputs, making each output sample reliant exclusively on a limited number of input samples and the corresponding filter coefficients.

The FIR filter is renowned for its accuracy and simple design, ensuring stability and ease of implementation This finite nature makes it a favored option for applications that require high precision and fast response times.

An FIR filter is built on a series of coefficients, known as taps, and an array of input samples The output samples are generated by calculating the sum of weighted input samples, with each sample being multiplied by its corresponding coefficient.

The FIR filter operates by applying specific coefficients to input samples and summing the weighted values to produce a new output sample This linear process is straightforward and intuitive, making the FIR filter a versatile and user-friendly solution for a wide range of applications.

Designing an FIR filter can be accomplished using various techniques, including window functions like Hamming and Blackman, as well as optimization methods such as the Parks-McClellan and Remez algorithms Each technique has distinct advantages and limitations that depend on the specific needs of the application.

FIR filters offer significant benefits due to their exceptional precision and stability By eliminating feedback from previous outputs, they effectively reduce the likelihood of unwanted oscillations, making them highly suitable for applications that demand reliability and consistency.

FIR filters are essential in numerous fields such as audio processing, image processing, digital communication, and system control As technology advances and the demand for digital signal processing grows, FIR filters are expected to remain crucial and continue to evolve in their applications.

THEORETICAL BACKGROUND

FIR filters, or Finite Impulse Response filters, rely on a limited sequence of input samples and filter coefficients to determine their output The filter's behavior and frequency response are defined by its finite-length impulse response coefficients These filters are widely used in digital signal processing for applications including noise reduction, signal enhancement, and frequency shaping.

Design Methodologies for FIR Filters:

- Various design methodologies exist for specifying the coefficients of FIR filters

- to achieve desired frequency responses

- Windowing techniques, including the Hamming and Kaiser windows, provide

- intuitive ways to design FIR filters with specific passband and stopband characteristics

- Frequency sampling methods allow direct control over the filter’s frequency response by specifying magnitude and phase characteristics at discrete frequency points

- Optimization algorithms such as the Parks-McClellan algorithm offer systematic

- approaches for designing FIR filters with optimal frequency response properties

FPGA Implementation of FIR Filters:

- Field-Programmable Gate Arrays (FPGAs) provide a flexible and reconfigurable

- platform for implementing FIR filters with high computational efficiency

- The DE1 board, featuring an Altera Cyclone II FPGA, offers a suitable environment for FPGA-based signal processing applications

- FPGA implementation of FIR filters involves translating filter algorithms into

- hardware description language (HDL) code, such as Verilog or VHDL, and synthesizing the code to generate hardware configuration files

- Considerations such as resource utilization, clock frequency, and input/output interfaces are crucial for optimizing FPGA implementations of FIR filters on the DE1 board

- Rigorous performance evaluation and validation are essential to ensure the functionality and efficacy of FPGA-based FIR filters

- Simulation-based testing and hardware-in-the-loop (HIL) testing validate the performance of FPGA-implemented FIR filters under diverse operating conditions

- Comparative analysis against theoretical models and simulation results corroborates the accuracy and reliability of FPGA-based FIR filter implementations

2.3.2 FIR filter for audio signals bases on FPGA

In signal processing, a filter is a crucial device that selectively extracts usable frequencies while rejecting unwanted noise An optimal filter allows only specific frequencies to pass, determined by its cutoff frequency The four main types of filters include band pass, band stop, high pass, and low pass Electric filters, commonly used in televisions and radios, enable specific channel frequencies to pass through while blocking others Among the various filter types, FIR filters, also known as non-recursive filters, are often utilized in signal processing.

The output of an FIR filter is influenced by both past and present inputs, leading to a stable and straightforward application This characteristic makes FIR filters highly suitable for hardware implementation To enhance performance, it may be necessary to utilize a filter with a greater number of coefficients and taps, depending on specific hardware requirements.

The frequency response of the FIR filter in the z-domain and the relationship between y(n) and x(n) are displayed in the equations below y(n) = ∑ 𝑛−1 𝑘=0 𝑏 𝑘 𝑥(𝑛 − 𝑘) , H(z) = ∑ 𝑛−1 𝑘=0 𝑏 𝑘 𝑍 −𝑘 [ 2.1]

The coefficients of the FIR filter are represented by 𝑏 𝑘, and this type of filter is characterized by the absence of feedback Its architecture can be illustrated through a series of block diagrams, commonly referred to as tapped delay lines or direct realization.

Figure 2 1 Direct realisation of FIR filter

FPGA platforms have evolved significantly, enabling efficient reconfigurable hardware design for high-speed processing, particularly in digital signal processing The Very High-Speed Integrated Circuits Hardware Description Language (VHDL) is widely recognized for its ability to reprogram FPGAs to meet specific designer requirements FPGAs find diverse applications in fields such as image processing, audio processing, speech recognition, and high-performance computing.

The International Technology Roadmap for Semiconductors (ITRS) aims to minimize costs while shrinking the size of electronic components For example, Field-Programmable Gate Arrays (FPGAs) are affordable and feature numerous components, demonstrating that as component sizes diminish, performance can simultaneously improve This trend often leads to reduced power consumption in electronic devices.

FPGAs, unlike Application Specific Integrated Circuits (ASICs), offer the flexibility of being reprogrammed for various applications, making them a versatile choice for designers This study focuses on the Cyclone II FPGA, known for its cost-effectiveness, embedded CPU support, and integrated DSP multipliers The Altera DE1 board, which features the Cyclone II FPGA, provides numerous capabilities, making it suitable for diverse design projects and the development of complex digital systems.

Implement FIR lowpass filter on DE1kit

DESIGN SPECIFICATIONS AND IMPLEMENTATION

The proposed system is designed to meet the below requirements:

Three blocks have been created and assessed to gain insights into the functioning of the entire system These blocks include:

• S2P Adaptor (responsible for converting between serial and parallel data)

To obtain a filtered audio signal, it is essential to initialize the Codec block using the I2C protocol, as it does not have a preset configuration at power-up Next, the S2P Adaptor block converts the serial digital signal into a parallel format, which is then sent to the FIR filter for processing Finally, the filtered signal is converted back to a serial format through the S2P block and directed to the Codec output port.

Figure 3 1 The audio digital filter system

CODEC INITIALIZATION

The initialization phase is essential for Codec operation, setting parameters like a 44100 Hz sample rate and two input channels (left and right), though only the left channel is utilized Data bits stored in registers control the settings, and loading these bytes enables audio signal transmission through the control interface via SCLK and SDIN pins, where SDIN manages serial data and SCLK controls the clock The I2C protocol facilitates codec initialization by establishing the SDIN signal's start and end conditions and regulating the data configurations After transmitting every eight bits, the Codec awaits an acknowledgment bit (ACK) from the FPGA to confirm successful data reception, as illustrated in Figure 3.2.

To initialize the Codec, SDIN transmits 11 words of 24-bit data, where the first 8 bits include a 7-bit chip address and a 1-bit read/write indicator The subsequent 8 bits specify the register address, and the final 8 bits contain the actual customization data Data transmission is regulated by SCLK, which can operate at a maximum frequency of 500 kHz, but can also function at lower frequencies for verification purposes The transmission begins with a start condition, marked by SDIN transitioning from high to low while SCLK remains high, and follows an MSB to LSB order If an erroneous address is detected, the Codec awaits a new start condition Upon receiving the correct address bits and an R/W bit of 0, SDIN transmits eight bits and waits for acknowledgment This cycle continues for each 24-bit word, concluding with the detection of a stop condition when SDIN transitions from low to high while SCLK is high.

After transmitting all configuration data, the codec returns to idle mode, awaiting a new start condition To fully understand the 11 data words, it is vital to grasp the content of each register, as the I2C Protocol provides multiple options for designers to meet their goals A thorough knowledge of all registers is necessary to effectively utilize these options, as illustrated in the table below.

S2P ADAPTER BLOCK

Before reaching the FIR filter block, the S2P adaptor converts digital data from the Codec from a serial to a parallel format After processing, the FIR block sends the data back to the S2P adaptor, which then converts it from parallel to serial, as illustrated in Figure 5.

The system features two interfaces: a digital audio interface and a paralleling interface The "BCLK" is a clock signal produced by the FPGA in the digital audio interface, crucial for identifying data bits numbered one to sixteen This identification occurs when the BCLK transitions from high to low (falling edge) while the LRC signal is strong The first bit is read at its center due to the stability of the architecture As illustrated in Figure 6, data transmission occurs when BCLK rises from low to high (rising edge), while data reception takes place on the descending edge of BCLK.

Figure 3.4 highlights the difference between audio input serial data (ADCDAT) and audio output serial data (DACDAT), both of which commence with the LRC signal that also acts as a BCLK reference The most significant bit (MSB) and the data streams for ADCDAT and DACDAT are transmitted simultaneously, with each bit requiring one BCLK cycle for the left and right channels To ensure efficient data processing by the FIR filter, idle time intervals of 32 bits are implemented, starting at the conclusion of the left and right channels and extending to the next LRC signal.

Figure 3 4 Block diagram of S2P Adapter

Synchronizing signals between the sender and receiver via a parallel interface is crucial for ensuring the proper functioning of both components The handshake method, which relies on the Strobe and Ready signals, is employed to facilitate this synchronization.

Figure 3 6 Strobe/Ready handshaking (parallel interface)

The S2P and FIR blocks communicate using a handshaking technique, where the Strobe signal indicates the availability of a 16-bit data packet for broadcast, and the Ready signal shows the receiver's status When the S2P Adapter is ready to send data, the STBin signal is set high, signaling readiness to communicate if the FIR-generated RDYin signal is low A high RDYin indicates that the FIR filter is busy processing data, and once completed, it will set RDYin low to signify readiness to transfer data back to the S2P Adapter, repeating the same protocol.

FIR FILTER BLOCK

The FIR filter block features eight taps and eight coefficients, specifically valued at -1260, 7827, 12471, 16384, 12471, 7827, and -1260 The complete equation for the FIR filter can be expressed as y(n) = (-1260, 7827, 12471, 16384).

The FIR filter's data shifter comprises seven stages, each represented by a 16-bit register As illustrated in Figure 3.5, the output from each 16-bit register is multiplied by FIR coefficients using a single multiplier Furthermore, an accumulator is necessary, potentially requiring 35 bits to sum the results from the multiplier and transmit the complete output, including the essential 16 bits, to the subsequent stage.

Figure 3 7 The concept of FIR low pass design

Figure 3.6 shows this FIR filter’s frequency response

Figure 3 8 The frequency response of the FIR low pass filter

The filter operates as a low pass, allowing the input signal to pass through up to approximately 9 kHz in the stop band area The filter is designed according to specific requirements, along with other necessary blocks for the overall system Each block is implemented on an FPGA with code written in VHDL Simulation of these procedures is performed using the Quartus II software tool, yielding accurate results when the appropriate test bench is utilized.

MАIN АLGORITHMS

First Process Block (for generating AUD_XCK and AUD_BCLK to codec):

• Triggered byrising_edge (clk_in) o If counter equals 283: Reset counter to 0 and toggle internal_clk_out o Else: Increment counter

• Second Process Block (for generating codec_clk_out): o Triggered by rising_edge(clk_in)

▪ If counter1 equals 2: Reset counter1 to 0 and toggle codec_clk

• Output Assignments: o Assign internal_clk_out to clk_out o Assign internal_clk_out to bclk_codec o Assign codec_clk to codec_clk_out

• Triggered by ’rising edge (CLOCK 50)

• Check if RES_N is ’1’ (reset condition) Then, initialize f_div, sr, b_cnt, w_cnt, SCLK, and temp

• Check if f_div, b_cnt, and w_cnt are all 0 (deadlock condition) Do nothing, wait for reset

• Otherwise, proceed to modify reference counters o If f_div is 0: Reset f_div to 499

▪ If b_cnt is 0 (end of word): Reset b_cnt to 28 Decrement w_cnt o Otherwise: Decrement b_cnt

• Generate SCLK o If f_div is 374, set SCLK to ’1’ o If f_div is 124, set SCLK to ’0’

To generate SDIN, set temp to '0' (start bit) when b_cnt is 28 and f_div is 249 For acknowledgment bits, if b_cnt is 19, 10, or 1 and f_div is 499, also set temp to '0' When b_cnt is 0 and f_div is 249, set temp to '1' (stop bit) For all other cases where b_cnt is not special and f_div is 499, shift the shift register (sr) and set temp to sr(11*24).

• Assign SDIN o Set SDIN to high impedance (’Z’) during ack bits, otherwise set it to temp

• Triggered by ’rising edge(CLOCK 50)

• Check if RES_N is ’1’ (reset condition) Determine if the reset signal is active

• Update old-BCLK

Ngày đăng: 20/12/2024, 15:13

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w