Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I have the truth table done along with everything else but I need help writing the Verilog code. What I have is: module HW8P1

image text in transcribedimage text in transcribed

So I have the truth table done along with everything else but I need help writing the Verilog code.

What I have is:

module HW8P1 (A1, A0, B1, B0, O);

input A1,A0,B1,B0;

output O;

assign O = (~A1 & ~A0 & ~B1 & B0) | (~A1 & ~A0 & B1 & B0) | (~A1 & ~A2 & B1 & ~B0) | (~A1 & A0 & B1 & B0) | (~A1 & A0 & B1 & ~B0) | (A1 & ~A0 & B1 & B0)

endmodule

When I run it it says I have a syntax error on line 8 which is the endmodule and then another syntax error in the continuous assignment; the assign O line.

Design a comparator that takes four bits (Al, A0, B1, B0) as input and produces one bit (O) as output. O is 1 if and only if the binary value of AlA0 is less than the B1B0 when both pairs of bits are regarded as 2-bit unsigned integers (a) Complete the following truth table. (10 points) Inputs Output 0 0 0 0 0 0 0 0 0 (b) Write the sum-of-product form for the output O without any simplification. (10 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions