Need help Testh bench code in Verilog module Examen1 #(parameter P = 4) (     input [P:0] e_a,     input [P:0] e_b,     output reg [P+1:0] vs_a );     always @*       begin          if (e_a[P] == e_b[P])             begin                  vs_a[P:0] = e_a[P-1:0] + e_b[P-1:0];                 vs_a[P+1] = e_a[P];             end                 else                      begin                          if (e_a[P-1:0] > e_b[P-1:0])                             begin                                 vs_a[P:0] = e_a[P-1:0] - e_b[P-1:0];                                 vs_a[P+1] = e_a[P];                             end                         else                                 begin                                 vs_a[P:0] = e_b[P-1:0] - vs_a[P-1:0];                                 vs_a[P+1] = e_b[P];                             end                     end             end     endmodule THIS IS THE TEST BENCH   module Examen1_TB;     #(parameter P=4);      reg [P:0] in_a; reg [P:0] in_b; wire [P+1:0] in_s; Examen1_Ins dut(.e_a(in_a), .e_b(in_b), .vs_a(in_s));  initial begin     in_a = 5'b 10101;     in_b = 5'b 10100;     #17;     in_a = 5'b 10011;     in_b = 5'b 01010;     #17;     in_a = 5'b 00001;     in_b = 5'b 10001;     #17;     in_a = 5'b 10110;     in_b = 5'b 01101;     #17; end endmodule

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Need help Testh bench code in Verilog
module Examen1
#(parameter P = 4)
(
    input [P:0] e_a,
    input [P:0] e_b,
    output reg [P+1:0] vs_a
);
    always @* 
     begin 
        if (e_a[P] == e_b[P])
            begin 
                vs_a[P:0] = e_a[P-1:0] + e_b[P-1:0];
                vs_a[P+1] = e_a[P];
            end
                else 
                    begin 
                        if (e_a[P-1:0] > e_b[P-1:0])
                            begin
                                vs_a[P:0] = e_a[P-1:0] - e_b[P-1:0];
                                vs_a[P+1] = e_a[P];
                            end
                        else    
                            begin
                                vs_a[P:0] = e_b[P-1:0] - vs_a[P-1:0];
                                vs_a[P+1] = e_b[P];
                            end
                    end
            end    
endmodule

THIS IS THE TEST BENCH

 

module Examen1_TB;
    #(parameter P=4);
    

reg [P:0] in_a;
reg [P:0] in_b;
wire [P+1:0] in_s;

Examen1_Ins dut(.e_a(in_a), .e_b(in_b), .vs_a(in_s)); 
initial begin
    in_a = 5'b 10101;
    in_b = 5'b 10100;
    #17;
    in_a = 5'b 10011;
    in_b = 5'b 01010;
    #17;
    in_a = 5'b 00001;
    in_b = 5'b 10001;
    #17;
    in_a = 5'b 10110;
    in_b = 5'b 01101;
    #17;
end
endmodule

 

IMAGE ERRORS

I don't understand what I'm doing wrong, if you could solve it for me I would appreciate it.

Tvbe ID Message
X 10170 Verilog HDL syntax error at Examen1_TB.v(2) near text: "#"; expecting "endmodule". Check for and fix any syntax errors that appear immediately before or at the specified
10170 Verilog HDL syntax error at Examen1_TB. v(2) near text: ")"; expecting ";". Check for and fix any syntax errors that appear immediately before or at the specified keyword.
X 10112 Ignored design unit "Examen1_TB" at Examen1_TB.v(1) due to previous errors
Ⓡ 12021 Found 0 design units, including 0 entities, in source file examen1_tb.v
> X
Quartus Prime Analysis & Synthesis was unsuccessful. 3 errors, 1 warning
293001 Quartus Prime Full Compilation was unsuccessful. 5 errors, 1 warning
Transcribed Image Text:Tvbe ID Message X 10170 Verilog HDL syntax error at Examen1_TB.v(2) near text: "#"; expecting "endmodule". Check for and fix any syntax errors that appear immediately before or at the specified 10170 Verilog HDL syntax error at Examen1_TB. v(2) near text: ")"; expecting ";". Check for and fix any syntax errors that appear immediately before or at the specified keyword. X 10112 Ignored design unit "Examen1_TB" at Examen1_TB.v(1) due to previous errors Ⓡ 12021 Found 0 design units, including 0 entities, in source file examen1_tb.v > X Quartus Prime Analysis & Synthesis was unsuccessful. 3 errors, 1 warning 293001 Quartus Prime Full Compilation was unsuccessful. 5 errors, 1 warning
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Public key encryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education