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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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>

**Educational Content on Sorting Module: Sort2**

**Overview:**

This educational content focuses on a module named "Sort2," designed using Verilog. It explains the module's operation with three inputs (a, b, s) and two outputs (x, y). The primary function of Sort2 involves sorting values based on a control input.

**Sort2 Module Functionality:**

- **Inputs:**
  - \( a \)
  - \( b \)
  - \( s \) (control input)
  
- **Outputs:**
  - \( x \)
  - \( y \)

**Function Table:**

| \( s \) | \( a \) | \( b \) | \( x \) | \( y \) | Comment                   |
|---------|---------|---------|---------|---------|---------------------------|
| 0       | 0       | 0       | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum           |
| 0       | 0       | 1       | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum           |
| 0       | 1       | 0       | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum           |
| 0       | 1       | 1       | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum           |
| 1       | 0       | 0       | \( x = \text{max}(a, b) \) | \( y = \text{min}(a, b) \) | Sorts by maximum           |
| 1       | 0       | 1       | \( x = \text{max}(a, b) \) | \( y = \text{min}(a, b) \) | Sorts by maximum           |
| 1       | 1       | 0       | \( x = \text{max}(a, b) \) | \( y = \text{min
Transcribed Image Text:**Educational Content on Sorting Module: Sort2** **Overview:** This educational content focuses on a module named "Sort2," designed using Verilog. It explains the module's operation with three inputs (a, b, s) and two outputs (x, y). The primary function of Sort2 involves sorting values based on a control input. **Sort2 Module Functionality:** - **Inputs:** - \( a \) - \( b \) - \( s \) (control input) - **Outputs:** - \( x \) - \( y \) **Function Table:** | \( s \) | \( a \) | \( b \) | \( x \) | \( y \) | Comment | |---------|---------|---------|---------|---------|---------------------------| | 0 | 0 | 0 | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum | | 0 | 0 | 1 | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum | | 0 | 1 | 0 | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum | | 0 | 1 | 1 | \( x = \text{min}(a, b) \) | \( y = \text{max}(a, b) \) | Sorts by minimum | | 1 | 0 | 0 | \( x = \text{max}(a, b) \) | \( y = \text{min}(a, b) \) | Sorts by maximum | | 1 | 0 | 1 | \( x = \text{max}(a, b) \) | \( y = \text{min}(a, b) \) | Sorts by maximum | | 1 | 1 | 0 | \( x = \text{max}(a, b) \) | \( y = \text{min
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Where is part c?

Solution
Bartleby Expert
SEE SOLUTION
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY