Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ156
Page ↗
Q156FWASIC interview problem

Clear the lowest set bit

TechniquesBitsMask
DifficultyEasy
TopicBit Manipulation
LanguageSystemVerilog
Requirements2 checkpoints
01

Problem

Return x with its least-significant 1 bit cleared.

Example input and output

Use this case to check your interpretation
Input
value = 8'b1011_0000
Output
8'b1010_0000
Explanation

ANDing with value - 1 clears only the lowest set bit, which is bit 4 here.

02

Requirements (2)

  • Return zero when x is zero.
  • Use one arithmetic and one bitwise operation.