Write behavioral Verilog code for a module called “Sort2” (pictured below) with three inputs s, a, b and two outputs x, y. The module’s function is also described below; in the function table, a “–” represents a don’t care. Also the function table has s, a as inputs, but the outputs x, y are expressed in terms of the third input b. In words, the “function table” to the left translates to the following: When s = 0, the smallest value among a and b goes to x and the other value goes to y. When s = 1, the largest value among a and b goes to x and the other value goes to y.
If you have trouble reading the picture please let me know.
8. (a) Write behavioral Verilog code for a module called “Sort2” (pictured below) with three inputs s, a, b and two outputs x, y. The module’s function is also described below; in the function table, a “–” represents a don’t care. Also the function table has s, a as inputs, but the outputs x, y are expressed in terms of the third input b.
In words, the “function table” to the left translates to the following: When s = 0, the smallest value among a and b goes to x and the other value goes to y. When s = 1, the largest value among a and b goes to x and the other value goes to y.
(b) Structurally connect copies (or instantiations) of the module Sort2 to construct the module Bitonic with four inputs a0,a1,a2,a3 and four outputs z0,z1,z2,z3 shown below; each box in the figure below represents an instantiation of Sort2. Further, the inputs and outputs of the instantiations are located as in the figure above; namely, input to the top of the box is s, top input to the side is a, bottom output is y and so on.
(c) Try out the following values for input ha0,a1,a2,a3i on the module Bitonic. Determine the outputs and try to guess what module Bitonic does. Values of A to try out: <1,0,1,0> , <0,1,0,0> , <1,1,0,1> , <1,1,1,0>
![8. (a) Write behavioral Verilog code for a module called "Sort2" (pictured below) with
three inputs s, a,b and two outputs z, y. The module's function is also described
below, in the function table, a "" represents a don't care. Also the function table
has s, a as inputs, but the outputs z,y are expressed in terms of the third input
b
I
Sort2
#1
comment
000-min(a, b), y-max(a, b)
min(a, b), y = max(a, b)
max(a, b), y min(a, b)
11-max(a, b), y = min(a, b)
0 161
1060
1
In words, the "function table to the left translates to the following:
Whens = 0, the smallest value among a and 6 goes to ar and the other value goes
to y. When s-1, the largest value among a and & goes to x and the other value
goes to y.
8 ay
(b) Structurally connect copies (or instantiations) of the module Sort2 to construct
the module Bitonic with four inputs as, 41, 42, and four outputs 20, 21, 22, 23
shown below; each box in the figure below represents an instantiation of Sort2.
Further, the inputs and outputs of the instantiations are located as in the figure
above, namely, input to the top of the box is s, top input to the side is a, bottom
output is y and so on.
Po
P₂
(c) Try out the following values for imput (₁, ₂.s) on the module Bitonic.
Determine the outputs and try to guess what module Bitonic does.
Values of A to try out: (1,0,1,0), (0,1,0,0), (1,1,0,1), (1,1,1,0)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F9ea0e50e-bc61-40aa-a108-fd1d63d4d69b%2Feb4a0ac3-6816-4dec-962f-757e43aa2b1e%2F623lqc_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)