<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mahnoor Zia on Medium]]></title>
        <description><![CDATA[Stories by Mahnoor Zia on Medium]]></description>
        <link>https://medium.com/@mahnoorzia101?source=rss-a80856978245------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EoIrpzhlb_zj-zc-JqTlbg.png</url>
            <title>Stories by Mahnoor Zia on Medium</title>
            <link>https://medium.com/@mahnoorzia101?source=rss-a80856978245------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:43:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mahnoorzia101/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Seven Segment Displays on the FPGA Nexys A7 Board]]></title>
            <link>https://medium.com/@mahnoorzia101/seven-segment-displays-on-the-fpga-nexys-a7-board-438e13972408?source=rss-a80856978245------2</link>
            <guid isPermaLink="false">https://medium.com/p/438e13972408</guid>
            <category><![CDATA[fpga-programming]]></category>
            <category><![CDATA[fpga]]></category>
            <category><![CDATA[verilog]]></category>
            <category><![CDATA[xilinx-vivado]]></category>
            <category><![CDATA[seven-segment-display]]></category>
            <dc:creator><![CDATA[Mahnoor Zia]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 16:12:22 GMT</pubDate>
            <atom:updated>2025-11-15T16:12:22.104Z</atom:updated>
            <content:encoded><![CDATA[<p>This article explains how seven segment displays work on the Nexys A7 FPGA board. It also guides you through the design of an eight digit hex to seven segment decoder using Verilog, decoders, and multiplexing techniques.</p><h3>What Is a Seven Segment Display</h3><p>A seven segment display consists of seven individually controlled LEDs arranged to form the shape of a digit. Each LED represents one segment labeled a through g. By illuminating specific combinations of these segments, you can display any hexadecimal value from 0 to F.</p><p>Seven segment displays are available in two configurations:</p><h4>Common Anode</h4><p>All anodes of the LED segments are tied together. The display turns on when the cathode is driven to logic low.</p><h4>Common Cathode</h4><p>All cathodes of the LED segments are tied together. The display turns on when the anode is driven to logic high.</p><p>The Nexys A7 uses the common anode configuration.</p><h3>Seven Segment Displays on the Nexys A7</h3><p>The board provides two four digit seven segment display modules for a total of eight digits. Each module is common anode. The seven segment cathode lines labeled CA through CG are shared across all digits, while each digit has its own anode enable signal named AN0 through AN7.</p><h4>Multiplexing Architecture</h4><p>Instead of driving all digits simultaneously the Nexys A7 uses time based multiplexing. The steps are as follows:</p><p>• All segment lines CA through CG are shared across digits<br> • Only one digit anode line is activated at a time<br> • The system cycles between digits rapidly<br> • The refresh rate is fast enough that the human eye perceives all digits as being continuously illuminated</p><h3>Hex to Seven Segment Mapping</h3><p>A four bit hexadecimal number corresponds to a seven bit output pattern that controls segments a through g. The table below summarizes these patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*piPclI3wScyk5qRk1JOKeg.png" /></figure><h3>System Architecture</h3><p>Your Verilog design accomplishes the following tasks:</p><ul><li>It reads a four bit hexadecimal input from the FPGA switches<br> • It converts the input value into the corresponding seven segment pattern<br> • It displays the pattern across all eight digits using multiplexing<br> • It mirrors the switch inputs on on board LEDs for debugging</li></ul><h3>Complete Verilog Implementation</h3><p>The Verilog implementation includes:</p><h4>Slow Clock Module</h4><p>A divider that reduces the 100 MHz system clock to a frequency suitable for refreshing each digit at a visible rate.</p><h4>Hex to Segment Decoder</h4><p>A case statement that maps the four bit input to the eight bit CA pattern.</p><h4>Digit Multiplexer</h4><p>A rotating pattern that activates AN0 through AN7 sequentially at each rising edge of the slow clock.</p><pre>`timescale 1ns / 1ps<br><br>module seven_segment_display(<br>    input  [3:0] SW,<br>    input        CLK,<br>    output reg [7:0] CA,<br>    output reg [7:0] AN,<br>    output reg [3:0] LED<br>);<br><br>    wire Clk_Slow;<br><br>    // Instantiate slow clock<br>    slow_clock S1(<br>        .CLK(CLK),<br>        .Clk_Slow(Clk_Slow)<br>    );<br><br>    // Initial value for anodes<br>    initial begin<br>        AN &lt;= 8&#39;b11111110;<br>    end<br><br>    // Segment display based on SW<br>    always @(*) begin<br>        case (SW)<br>            4&#39;b0000: CA = 8&#39;b11000000;<br>            4&#39;b0001: CA = 8&#39;b11111001;<br>            4&#39;b0010: CA = 8&#39;b10100100;<br>            4&#39;b0011: CA = 8&#39;b10110000;<br>            4&#39;b0100: CA = 8&#39;b10011001;<br>            4&#39;b0101: CA = 8&#39;b10010010;<br>            4&#39;b0110: CA = 8&#39;b10000010;<br>            4&#39;b0111: CA = 8&#39;b11011000;<br>            4&#39;b1000: CA = 8&#39;b10000000;<br>            4&#39;b1001: CA = 8&#39;b10011000;<br>            4&#39;b1010: CA = 8&#39;b10001000;<br>            4&#39;b1011: CA = 8&#39;b10000000;<br>            4&#39;b1100: CA = 8&#39;b11000110;<br>            4&#39;b1101: CA = 8&#39;b10100001;<br>            4&#39;b1110: CA = 8&#39;b10000110;<br>            4&#39;b1111: CA = 8&#39;b10001110;<br>            default: CA = 8&#39;b11111111;<br>        endcase<br>    end<br><br>    // LEDs mirror the switches<br>    always @(*) begin<br>        LED = SW;<br>    end<br><br>    // Rotate through anodes using the slow clock<br>    always @(posedge Clk_Slow) begin<br>        case (AN)<br>            8&#39;b11111110: AN &lt;= 8&#39;b11111101;<br>            8&#39;b11111101: AN &lt;= 8&#39;b11111011;<br>            8&#39;b11111011: AN &lt;= 8&#39;b11110111;<br>            8&#39;b11110111: AN &lt;= 8&#39;b11101111;<br>            8&#39;b11101111: AN &lt;= 8&#39;b11011111;<br>            8&#39;b11011111: AN &lt;= 8&#39;b10111111;<br>            8&#39;b10111111: AN &lt;= 8&#39;b01111111;<br>            8&#39;b01111111: AN &lt;= 8&#39;b11111110;<br>            default:     AN &lt;= 8&#39;b11111110;<br>        endcase<br>    end<br><br>endmodule<br><br><br>// -------------------------<br>// Slow Clock Module<br>// -------------------------<br>module slow_clock(<br>    input CLK,<br>    output reg Clk_Slow<br>);<br><br>    reg [31:0] counter_out;<br><br>    initial begin<br>        counter_out = 32&#39;h00000000;<br>        Clk_Slow    = 0;<br>    end<br><br>    always @(posedge CLK) begin<br>        counter_out &lt;= counter_out + 32&#39;h00000001;<br><br>        if (counter_out &gt; 32&#39;h00F5E100) begin<br>            counter_out &lt;= 32&#39;h00000000;<br>            Clk_Slow    &lt;= ~Clk_Slow;<br>        end<br>    end<br><br>endmodule</pre><h3>Nexys A7 Constraint File</h3><p>The XDC constraint file assigns appropriate pins for:</p><p>• Clock input<br> • Four input switches<br> • Four LEDs for debugging<br> • Segment cathodes CA0 through CA7<br> • Anode enable signals AN0 through AN7<br> • All pins use the LVCMOS33 I O standard</p><p>These mappings ensure correct interaction between the FPGA and the seven segment display hardware.</p><pre>set_property -dict { PACKAGE_PIN E3  IOSTANDARD LVCMOS33 } [get_ports { CLK }];<br>create_clock -add -name sys_clk -period 10.00 -waveform {0 5} [get_ports { CLK }];<br><br>set_property -dict { PACKAGE_PIN J15 IOSTANDARD LVCMOS33 } [get_ports { SW[0] }];<br>set_property -dict { PACKAGE_PIN L16 IOSTANDARD LVCMOS33 } [get_ports { SW[1] }];<br>set_property -dict { PACKAGE_PIN M13 IOSTANDARD LVCMOS33 } [get_ports { SW[2] }];<br>set_property -dict { PACKAGE_PIN R15 IOSTANDARD LVCMOS33 } [get_ports { SW[3] }];<br><br>set_property -dict { PACKAGE_PIN H17 IOSTANDARD LVCMOS33 } [get_ports { LED[0] }];<br>set_property -dict { PACKAGE_PIN K15 IOSTANDARD LVCMOS33 } [get_ports { LED[1] }];<br>set_property -dict { PACKAGE_PIN J13 IOSTANDARD LVCMOS33 } [get_ports { LED[2] }];<br>set_property -dict { PACKAGE_PIN N14 IOSTANDARD LVCMOS33 } [get_ports { LED[3] }];<br><br>set_property -dict { PACKAGE_PIN T10 IOSTANDARD LVCMOS33 } [get_ports { CA[0] }];  # CA<br>set_property -dict { PACKAGE_PIN R10 IOSTANDARD LVCMOS33 } [get_ports { CA[1] }];  # CB<br>set_property -dict { PACKAGE_PIN K16 IOSTANDARD LVCMOS33 } [get_ports { CA[2] }];  # CC<br>set_property -dict { PACKAGE_PIN K13 IOSTANDARD LVCMOS33 } [get_ports { CA[3] }];  # CD<br>set_property -dict { PACKAGE_PIN P15 IOSTANDARD LVCMOS33 } [get_ports { CA[4] }];  # CE<br>set_property -dict { PACKAGE_PIN T11 IOSTANDARD LVCMOS33 } [get_ports { CA[5] }];  # CF<br>set_property -dict { PACKAGE_PIN L18 IOSTANDARD LVCMOS33 } [get_ports { CA[6] }];  # CG<br>set_property -dict { PACKAGE_PIN H15 IOSTANDARD LVCMOS33 } [get_ports { CA[7] }];  # DP<br><br>set_property -dict { PACKAGE_PIN J17 IOSTANDARD LVCMOS33 } [get_ports { AN[0] }];<br>set_property -dict { PACKAGE_PIN J18 IOSTANDARD LVCMOS33 } [get_ports { AN[1] }];<br>set_property -dict { PACKAGE_PIN T9  IOSTANDARD LVCMOS33 } [get_ports { AN[2] }];<br>set_property -dict { PACKAGE_PIN J14 IOSTANDARD LVCMOS33 } [get_ports { AN[3] }];<br>set_property -dict { PACKAGE_PIN P14 IOSTANDARD LVCMOS33 } [get_ports { AN[4] }];<br>set_property -dict { PACKAGE_PIN T14 IOSTANDARD LVCMOS33 } [get_ports { AN[5] }];<br>set_property -dict { PACKAGE_PIN K2  IOSTANDARD LVCMOS33 } [get_ports { AN[6] }];<br>set_property -dict { PACKAGE_PIN U13 IOSTANDARD LVCMOS33 } [get_ports { AN[7] }];</pre><h3>How the Design Operates on Hardware</h3><p>The design operates in the following sequence:</p><ol><li>Switches SW0 through SW3 select a hexadecimal digit</li><li>The decoder module generates the appropriate CA to CG pattern</li><li>The multiplexer cycles the active anode from AN0 to AN7</li><li>Each digit is illuminated briefly but rapidly enough to appear fully lit</li><li>The LED outputs display the same binary value as the switches for verification</li></ol><h3>Demonstration Video</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9Rd8Otg5E2Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9Rd8Otg5E2Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9Rd8Otg5E2Y%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/88efc1ac7c32789787fcc93f737a203f/href">https://medium.com/media/88efc1ac7c32789787fcc93f737a203f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=438e13972408" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing an 8x1 Multiplexer Using 2x1 Multiplexers in Verilog]]></title>
            <link>https://medium.com/@mahnoorzia101/designing-an-8x1-multiplexer-using-2x1-multiplexers-in-verilog-fb48212f8633?source=rss-a80856978245------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb48212f8633</guid>
            <category><![CDATA[8x1-mux-using-2x1-muxs]]></category>
            <category><![CDATA[multiplexer-in-verilog]]></category>
            <category><![CDATA[2x1-mux-verilog-code]]></category>
            <category><![CDATA[verilog-multiplexer-code]]></category>
            <category><![CDATA[fpga-multiplexer-design]]></category>
            <dc:creator><![CDATA[Mahnoor Zia]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 19:29:46 GMT</pubDate>
            <atom:updated>2025-11-07T19:36:17.546Z</atom:updated>
            <content:encoded><![CDATA[<p>A <strong>multiplexer (MUX)</strong> is a combinational logic circuit that selects one of several input signals and forwards it to a single output line. In this article, we’ll design an <strong>8x1 multiplexer</strong> in Verilog by first building a <strong>2x1 MUX</strong> using dataflow modeling and then combining multiple 2x1 modules through structural modeling.</p><h3>Part (a): 2x1 Multiplexer Using Dataflow Modeling</h3><h4>Description</h4><p>A <strong>2x1 multiplexer</strong> has two input lines (a and b), one select line (sel), and one output (y):</p><ul><li>When sel = 0, the output y equals input b.</li><li>When sel = 1, the output y equals input a.</li></ul><h4>Verilog Code</h4><pre>// 2x1 Multiplexer using Dataflow Modeling<br>module mux2x1 (<br>    input wire a, b, sel,<br>    output wire y, ybar<br>);<br>    assign y = sel ? a : b;   // If sel=1 -&gt; output = a, else b<br>    assign ybar = ~y;         // Complement of output<br>endmodule</pre><h4>Explanation</h4><ul><li>The assign statement defines combinational behavior.</li><li>The ternary operator ? : selects between a and b based on sel.</li><li>ybar provides the inverted output, useful in logic designs.</li></ul><h3>Part (b): 8x1 Multiplexer Using 2x1 MUX Modules</h3><h4>Description</h4><p>An <strong>8x1 multiplexer</strong> can be constructed using <strong>seven 2x1 MUX modules</strong>.<br> It requires <strong>three select lines (</strong><strong>S[2:0])</strong> to choose one of eight data inputs (I[7:0]).</p><p><strong>Stage-wise Design:</strong></p><ul><li><strong>Level 1 (MUX1–MUX4):</strong> Controlled by S[0]</li><li><strong>Level 2 (MUX5–MUX6):</strong> Controlled by S[1]</li><li><strong>Level 3 (MUX7):</strong> Controlled by S[2]</li></ul><h4>Verilog Code</h4><pre>// 8x1 Multiplexer using 2x1 MUX modules (Structural Modeling)<br>module mux8x1 (<br>    input wire [7:0] I,   // 8 data inputs<br>    input wire [2:0] S,   // 3 select lines<br>    output wire Y         // Final output<br>);<br>    // Intermediate wires<br>    wire w1, w2, w3, w4;<br>    wire w5, w6;<br><br>    // Level 1: Select between input pairs (controlled by S[0])<br>    mux2x1 m1 (.a(I[0]), .b(I[1]), .sel(S[0]), .y(w1));<br>    mux2x1 m2 (.a(I[2]), .b(I[3]), .sel(S[0]), .y(w2));<br>    mux2x1 m3 (.a(I[4]), .b(I[5]), .sel(S[0]), .y(w3));<br>    mux2x1 m4 (.a(I[6]), .b(I[7]), .sel(S[0]), .y(w4));<br><br>    // Level 2: Combine outputs from level 1 (controlled by S[1])<br>    mux2x1 m5 (.a(w1), .b(w2), .sel(S[1]), .y(w5));<br>    mux2x1 m6 (.a(w3), .b(w4), .sel(S[1]), .y(w6));<br><br>    // Level 3: Final output (controlled by S[2])<br>    mux2x1 m7 (.a(w5), .b(w6), .sel(S[2]), .y(Y));<br>endmodule<br></pre><h4>Explanation</h4><ul><li>The design uses <strong>hierarchical structural modeling</strong>, where each mux2x1 instance acts as a smaller building block.</li><li>The select lines S[0], S[1], and S[2] determine which input is routed to the output.</li><li>This approach is modular, reusable, and well-suited for FPGA or ASIC implementation.</li></ul><h3>Part ( c ): Block Diagram</h3><p>Below is the <strong>block diagram</strong> of the 8x1 multiplexer constructed using seven 2x1 MUX modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0Kt0HPKCEAdiGbk8U7mMw.jpeg" /><figcaption><em>Figure 1: 8x1 MUX constructed from seven 2x1 MUX modules.</em></figcaption></figure><p><strong>Level 1:</strong> MUX1–MUX4 (controlled by S0)<br><strong>Level 2:</strong> MUX5–MUX6 (controlled by S1)<br><strong>Level 3:</strong> MUX7 (controlled by S2)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*OtE-HsjVnXUQJSA3cD84sw.png" /><figcaption><em>Figure 2: 3-bit truth table for select lines .</em></figcaption></figure><p>In this design, we first created a <strong>2x1 multiplexer</strong> using dataflow modeling, and then used it as a component to construct an <strong>8x1 multiplexer</strong> through structural modeling.<br> This demonstrates how <strong>complex digital systems</strong> can be efficiently developed in <strong>Verilog</strong> using <strong>simple, reusable building blocks</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb48212f8633" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of a 4-Bit Adder Circuit on the Nexys A7 Board Using Switches and LEDs]]></title>
            <link>https://medium.com/@mahnoorzia101/implementation-of-a-4-bit-adder-circuit-on-the-nexys-a7-board-using-switches-and-leds-a35dbbe2b6f4?source=rss-a80856978245------2</link>
            <guid isPermaLink="false">https://medium.com/p/a35dbbe2b6f4</guid>
            <dc:creator><![CDATA[Mahnoor Zia]]></dc:creator>
            <pubDate>Sun, 02 Nov 2025 21:51:04 GMT</pubDate>
            <atom:updated>2025-11-02T22:05:03.605Z</atom:updated>
            <content:encoded><![CDATA[<p>Digital systems often rely on arithmetic operations, and the adder circuit is one of the most fundamental components in computer architecture. In this article, we’ll walk through how to design and implement a 4-bit full adder on the Nexys A7 FPGA board, using the switches as input and LEDs as output indicators.</p><p>By the end, we’ll have a working hardware implementation that performs binary addition and displays results directly on the board.</p><h4>What is a Full Adder?</h4><p>A full adder is a combinational logic circuit that adds three binary inputs<strong> </strong>— usually two operand bits (<strong>A</strong> and <strong>B</strong>) and a carry-in © — and produces a sum and a carry-out.</p><p>It forms the building block for multi-bit addition circuits such as 4-bit, 8-bit, or even 32-bit adders.</p><p>Here’s the truth table for a 1-bit full adder:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*f3xdMmgqdp__QSRznPqdUg.png" /><figcaption>1-bit full adder</figcaption></figure><h3>Steps for Implementation on Nexys A7</h3><p>The project was implemented using Xilinx Vivado Design Suite with the following steps.</p><h4>Step 1: Create a New RTL Project</h4><ol><li>Open Vivado and select Create New Project → choose RTL Project.</li><li>For the device configuration:</li></ol><ul><li>Device Family: Artix-7</li><li>Device: XC7A100T-1CSG324</li><li>Package: CSG324</li><li>Speed Grade: -1</li></ul><p>These settings match the FPGA chip mounted on the Nexys A7 board<strong>.</strong></p><h4>Step 2: Write the Verilog Source Code</h4><p>The Verilog code below describes a<strong> 4-bit ripple carry full adder</strong> using gate-level modeling (i.e., using logic gates and, or, xor).</p><pre>module full_Adder(<br>    input [3:0] A,<br>    input [3:0] B,<br>    input       C,<br>    output [3:0] SUM,<br>    output      COUT<br>);<br><br>wire c1, c2, c3;<br><br>// First bit (LSB)<br>wire a1_0, a2_0, a3_0;<br>xor u1_0(a1_0, A[0], B[0]);<br>and u2_0(a2_0, A[0], B[0]);<br>and u3_0(a3_0, a1_0, C);<br>or  u4_0(c1, a2_0, a3_0);<br>xor u5_0(SUM[0], a1_0, C);<br><br>// Second bit<br>wire a1_1, a2_1, a3_1;<br>xor u1_1(a1_1, A[1], B[1]);<br>and u2_1(a2_1, A[1], B[1]);<br>and u3_1(a3_1, a1_1, c1);<br>or  u4_1(c2, a2_1, a3_1);<br>xor u5_1(SUM[1], a1_1, c1);<br><br>// Third bit<br>wire a1_2, a2_2, a3_2;<br>xor u1_2(a1_2, A[2], B[2]);<br>and u2_2(a2_2, A[2], B[2]);<br>and u3_2(a3_2, a1_2, c2);<br>or  u4_2(c3, a2_2, a3_2);<br>xor u5_2(SUM[2], a1_2, c2);<br><br>// Fourth bit (MSB)<br>wire a1_3, a2_3, a3_3;<br>xor u1_3(a1_3, A[3], B[3]);<br>and u2_3(a2_3, A[3], B[3]);<br>and u3_3(a3_3, a1_3, c3);<br>or  u4_3(COUT, a2_3, a3_3);<br>xor u5_3(SUM[3], a1_3, c3);<br><br>endmodule</pre><h4>Step 3: Synthesize the Circuit</h4><p>Click Run Synthesis in Vivado.<br> This process translates the Verilog code into a gate-level netlist, allowing Vivado to check for syntax errors and prepare logic for mapping onto FPGA resources.</p><h4>Step 4: Create the Constraint File (XDC)</h4><p>The constraint file tells Vivado which physical FPGA pins correspond to your inputs and outputs — in this case, switches and LEDs.</p><p>Here’s the XDC file snippet used:</p><pre>## Switches<br>set_property -dict { PACKAGE_PIN J15 IOSTANDARD LVCMOS33 } [get_ports { C }];<br>set_property -dict { PACKAGE_PIN L16 IOSTANDARD LVCMOS33 } [get_ports { B[0] }];<br>set_property -dict { PACKAGE_PIN M13 IOSTANDARD LVCMOS33 } [get_ports { B[1]}];<br>set_property -dict { PACKAGE_PIN R15 IOSTANDARD LVCMOS33 } [get_ports { B[2] }];<br>set_property -dict { PACKAGE_PIN R17 IOSTANDARD LVCMOS33 } [get_ports { B[3] }];<br>set_property -dict { PACKAGE_PIN T18 IOSTANDARD LVCMOS33 } [get_ports { A[0] }];<br>set_property -dict { PACKAGE_PIN U18 IOSTANDARD LVCMOS33 } [get_ports { A[1] }];<br>set_property -dict { PACKAGE_PIN R13 IOSTANDARD LVCMOS33 } [get_ports { A[2] }];<br>set_property -dict { PACKAGE_PIN T8  IOSTANDARD LVCMOS18 } [get_ports { A[3] }];<br><br>## LEDs<br>set_property -dict { PACKAGE_PIN H17 IOSTANDARD LVCMOS33 } [get_ports { SUM[0] }];<br>set_property -dict { PACKAGE_PIN K15 IOSTANDARD LVCMOS33 } [get_ports { SUM[1] }];<br>set_property -dict { PACKAGE_PIN J13 IOSTANDARD LVCMOS33 } [get_ports { SUM[2] }];<br>set_property -dict { PACKAGE_PIN N14 IOSTANDARD LVCMOS33 } [get_ports { SUM[3] }];<br>set_property -dict { PACKAGE_PIN R18 IOSTANDARD LVCMOS33 } [get_ports { COUT }];</pre><p>This mapping ensures:</p><ul><li>Switches (SW0–SW8) → serve as inputs for A, B, and Carry-in.</li><li>LEDs (LD0–LD4) → display the sum bits and final carry-out.</li></ul><h4>Step 5: Implement the Design</h4><p>After successful synthesis, click Run Implementation.<br>Vivado will map the synthesized logic onto the actual hardware resources available on the Artix-7 FPGA.</p><h4>Step 6: Generate and Download the Bitstream</h4><ol><li>Click Generate Bitstream → this creates a .bit configuration file for your design.</li><li>Connect the Nexys A7 board via USB.</li><li>Click Open Hardware Manager → Open Target →Auto Connect →Program Device.</li></ol><p>Once programmed, the design becomes active on the FPGA board.</p><h4>Example: 4-Bit Full Adder Table</h4><p>Let’s take a quick example for clarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*7xJfu_Zmcku9sWMqDak4Kg.png" /><figcaption>4-bit full adder</figcaption></figure><h4>Hardware Verification</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*z4kLJgGbkts-kRBxehHzew.png" /><figcaption>“General Purpose I/O Devices” diagram from the <a href="https://digilent.com/reference/programmable-logic/nexys-a7/reference-manual?srsltid=AfmBOopbaJzTpVjl_Csh11pHDKrDIcfKUB8uqdHt9Ze6xXKrYWL6FiHT">official Nexys A7 reference manual</a></figcaption></figure><p>You can find these pins at the bottom of your FPGA board as shown in the image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*pplF1vaoitst4MNvArHlbw.jpeg" /><figcaption>input pins (switches) and output pins (LEDs)</figcaption></figure><h4>Example Test Results</h4><p>For example:</p><ul><li>C = 1(SW0)</li><li>B = 0011 (SW1–SW4)</li><li>A = 0101 (SW5–SW8)<br> → LEDs (LD0 &amp; LD3) light up, and LD1, LD2, LD4(COUT) remains off as SUM=1001 and COUT=0</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ws8WWHRHCN9RKrvMXsZtSQ.jpeg" /><figcaption>Output: SUM=1001 &amp; COUT=0</figcaption></figure><ul><li>C = 0(SW0)</li><li>B = 1111 (SW1–SW4)</li><li>A = 1111 (SW5–SW8)<br> → LEDs (LD1 to LD4) light up, LD0(B[0]) remains off as SUM=1110 and COUT=1</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5o7qGLSFwwvgfgC3u0DESw.jpeg" /><figcaption>Output: SUM=1110 &amp; COUT=1</figcaption></figure><ul><li>C = 1(SW0)</li><li>B = 1111 (SW1–SW4)</li><li>A = 1111 (SW5–SW8)<br> → LEDs (LD0 to LD4) all light up</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EwtMGbUzaANhJXvC9ZgDkg.jpeg" /><figcaption>Output: SUM=1111 &amp; COUT=1</figcaption></figure><h4>Conclusion</h4><p>Through this article, we’ve demonstrated how a 4-bit full adder can be implemented on the Nexys A7 FPGA using Verilog and Vivado<strong>.</strong></p><p>The key learning outcomes include:</p><ul><li>Understanding gate-level modeling in Verilog.</li><li>Using constraint files (XDC) for physical pin mapping.</li><li>Implementing and testing a digital circuit on real FPGA hardware.</li></ul><p>Such projects bridge the gap between theoretical digital logic and practical hardware design, helping students grasp how FPGAs bring logic circuits to life.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a35dbbe2b6f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>