20+ câu trắc nghiệm Thiết kế hệ thống số dùng HDL có đáp án
21 câu · Đề ôn tập tổng hợp
Xem trước: đọc nhanh mọi câu dạng chữ, chưa tính giờ, chưa hiện đáp án. Luyện tập: chọn đáp án là biết đúng sai ngay, kèm lời giải. Thi thử: nộp bài mới chấm điểm và hiện lời giải.
Câu 1
Which of the following statements are true? (multiple choices)
Đáp án và lời giải
Đáp án: C
Câu 2
Which is not a correct method of specifying time scale in verilog?
Đáp án và lời giải
Đáp án: A
Câu 3
The task $stop is provided to
Đáp án và lời giải
Đáp án: D
Câu 4
If “clk” and “clear” are two inputs of a counter module, which of the following event expressions must be used if we want to implement asynchronous clear (assuming “clear” is active low, active high edge of “clk” signal is used for counting, and single “always” block is used for the implementation)?
Đáp án và lời giải
Đáp án: B
Câu 5
For the following code segment, the final value of variable “d” will be … integer a, b, c, d; initial begin a = 25; b = 12; c = 5; d = 17; a = b + c; b = a – 15; c = a + d; d = c + d; end
Đáp án và lời giải
Đáp án: B
Câu 6
Which of the following is true for the following module?
module
mydesign (a,b);
input [1:0]
b;
output reg
a;
always @(b)
begin
if (b==2'b00) a = 1'b0;
else if (b==2'b11) a = 1'b0;
else a = 1'b1;
end
end module
Đáp án và lời giải
Đáp án: D
Câu 7
Which of the following statements is/are true? (multiple choices)
Đáp án và lời giải
Đáp án: A
Câu 8
If A = 4b011 and B = 4b0011, then the result of A ** B will be
Đáp án và lời giải
Đáp án: D
Câu 9
The following code segment generates a periodic clock signal “clk” with time period:
initial clk
= 1’b1;
always #10
clk = ~clk;
Đáp án và lời giải
Đáp án: C
Câu 10
What does the following code segment indicate?
initial clk
= 1’b0;
always #5
clk = ~clk;
Đáp án và lời giải
Đáp án: A
Câu 11
Which of the following is true for the module given below? module mydesign (a,b,c); input c; output reg a, b; always @(c) begin if (c == 1’b0) begin b <= ~a; a <= ~(c | b); end else if (c == 1’b1) a <= ~(b ^ c); end endmodule (multiple choices)
Đáp án và lời giải
Đáp án: B
Câu 12
Which of the following is true about the following code segment?
integer x,
y;
initial
begin
x = 15;
y = 10;
end
initial
repeat (x) $display (“x=%d”, x);
initial
while (y < 12)
begin
y = y + 1;
x = x - 1;
end
Đáp án và lời giải
Đáp án: B
Câu 13
Consider the following Verilog module.
module
guess (data, cond, result);
input [7:0]
data;
input [1:0]
cond;
output reg
result;
always
@(data)
begin
if (cond == 2’b00)
result = |data;
else
result = ~^data;
end
endmodule
Which of the following are true when the module is synthesized? (multiple choices)
Đáp án và lời giải
Đáp án: B
Câu 14
What will the following code segment generate on synthesis, assuming that the four variables data0, data1, data2 and data3 map into four latches/flip-flops?
always @(posedge clock)
begin
data3 = din;
data2 = data3;
data1 = data2;
data0 = data1;
end
Đáp án và lời giải
Đáp án: C
Câu 15
What will the following code segment generate on synthesis, assuming that the four variables data0, data1, data2 and data3 map into four latches/flip-flops?
always @(posedge clock)
begin
data3 = din;
data2 = data3;
data1 = data2;
data0 = data1;
end
If A = 4b001x and B = 4b1011, then result of A + B will be
Đáp án và lời giải
Đáp án: C
Câu 16
What will the following code segment do?
always @(posedge clock)
begin
y = x;
z = y;
x = z;
end
Đáp án và lời giải
Đáp án: C
Câu 17
What does the construct “#5” indicate in simulation?
Đáp án và lời giải
Đáp án: D
Câu 18
Which of the following is true for the “repeat” loop?
Đáp án và lời giải
Đáp án: A
Câu 19
For the following Verilog code segment:
wire [7:0] A;
wire B;
assign B = ~|A;
If the value of A is 8’b00111001, what will be the value of {A[5:3], 3{B}}?
Đáp án và lời giải
Đáp án: A
Câu 20
If A, B, C and D are reg, reg, integer and wire variables respectively, each of size [7:0], which of the following is/are allowed inside a procedural block? (Multiple choice)
Đáp án và lời giải
Đáp án: B
Câu 21
Consider the following Verilog code segment:
wire [5:0] A, B;
wire C;
assign C=^A;
If the values of A and B are 5’b10011 and 5’b01110 respectively, what will be the value of {A[3:1], 2{C}, B[2:0]}?