
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
![Question 2
A Verilog module named "Sample" is declared as below:
module Sample(clock, reset, w, Q);
where input and output ports are defined as:
input clock, reset, w;
localparam m=8;
output reg [m-1:0] Q;
Q[O] is the right most bit and Q[m-1] is the left-most bit in the configuration.
Input w provides the serial input to the circuit.
Which of the following correctly implements a left-shift register?](https://content.bartleby.com/qna-images/question/daad9e7e-1f14-44d5-98ac-51623b651f9b/c6dd9e83-3265-4c83-bdd0-2c035ab7992e/ivm2sj_thumbnail.png)
Transcribed Image Text:Question 2
A Verilog module named "Sample" is declared as below:
module Sample(clock, reset, w, Q);
where input and output ports are defined as:
input clock, reset, w;
localparam m=8;
output reg [m-1:0] Q;
Q[O] is the right most bit and Q[m-1] is the left-most bit in the configuration.
Input w provides the serial input to the circuit.
Which of the following correctly implements a left-shift register?
![integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=m-1; k>=1; k=k-1)
Q[K]<=Q[k-1];
Q[m-1]<=w;
end
end
integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=1; k<=m-1; k=k+1)
Q[k]=Q[k-1];
Q[0]=w;
end
end
integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=m-1; k>=1; k=k-1)
Q[K]<=Q[K-1];
Q[0]<=w;
end
end
integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=1; k<=m-1; k=k+1)
Q[K-1]<=Q[k];
Q[m-1]<=w;
end
end](https://content.bartleby.com/qna-images/question/daad9e7e-1f14-44d5-98ac-51623b651f9b/c6dd9e83-3265-4c83-bdd0-2c035ab7992e/f6qwpgk_thumbnail.png)
Transcribed Image Text:integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=m-1; k>=1; k=k-1)
Q[K]<=Q[k-1];
Q[m-1]<=w;
end
end
integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=1; k<=m-1; k=k+1)
Q[k]=Q[k-1];
Q[0]=w;
end
end
integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=m-1; k>=1; k=k-1)
Q[K]<=Q[K-1];
Q[0]<=w;
end
end
integer k;
always@(posedge clock)
begin
if (reset)
Q<=0;
else
begin
for (k=1; k<=m-1; k=k+1)
Q[K-1]<=Q[k];
Q[m-1]<=w;
end
end
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- Write a function in MIPS Assembly Language that computes the next state of a linear feedback shift register (LFSR) given the current state of the LFSR. The LFSR should satisfy the taps given by the following polynomial: x^15 + x^14 +1 Your function should take the state as a 32-bit input parameter and return a 32-bit output value. Your main program for the function should call your LFSR function for the following input states and print the output state: 0x00000001 0xdeadbeef 0x200214c8 0x00000000arrow_forwardassembly programmingarrow_forwardQ2. [Structural Verilog] Design a 2-bit subtractor unit. Inputs are A and B, and output is S, 2-bits each. As a sub-module you can call the Full Adder module (E Assume this is given to you as library) which takes in 3 inputs (X, Y and Z) and produces 2 outputs (F, C). Write structural HDLarrow_forward
- When discussing string primitives, what 32-bit register is referred to as the accumulator?arrow_forwardIn 8086 ASM 64 bit, how to write assembly code for taking input for a single digit positive number, increment the input number by 2, write the single digit result, decrement the input number by 1 and then finally write the single digit result.arrow_forwardComplete a Verilog code for a 4-bit one-hot counter. Complete "your code here" boxes below (two parts). The "reset" is an active HIGH and will asynchronously_make the output to 4'b1000. 1000 → 0100 → 0010 → 0001→ 1000 → ... repeat!! module four_bit_ohc (clk, reset, q); output [3:0] q; input clk, reset; your code here always @(posedge clk, reset) begin // your code here end endmodulearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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 Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

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
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY