Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ868
Page ↗
Q868FWASIC interview problem

Associative-array traversal

TechniquesSystemVerilogContainer operations
DifficultyEasy
TopicData Structures
LanguageSystemVerilog
Format4 choices
01

Problem

What key values are displayed?

Starting declarationSystemVerilog
int aa[int];
int k;
initial begin
  aa[10] = 1; aa[-2] = 2; aa[5] = 3;
  void'(aa.first(k)); $write("%0d ", k);
  void'(aa.next(k));  $display("%0d", k);
end
02

Answer choices (4)