Which of the following steps detects the key in a 4*4 keyboard matrix ...
For detecting that whether the key is actually pressed or not, firstly this must be ensured that initially all the keys are closed. Then we need to mask the bits individually to detect that which key is pressed. Then we need to check that is the key actually pressed or not, by checking that whether the key pressed for a time more that 20 micro seconds.
View all questions of this test
Which of the following steps detects the key in a 4*4 keyboard matrix ...
Detection of Key in a 4*4 Keyboard Matrix
Masking of Bits
- Masking is a technique used to isolate certain bits from a sequence of bits.
- In the case of a 4*4 keyboard matrix, masking is used to select a particular row or column of keys.
- The bits corresponding to the selected row or column are set to 0, while the bits corresponding to the other rows or columns are set to 1.
Ensuring that Initially All Keys are Open
- Before detecting the key that is being pressed, it is important to ensure that all keys are initially open.
- This is done by setting all the row and column pins to high (i.e., logic level 1).
- By doing this, no key will be selected and no current will flow through any key.
Checking whether the Key is Actually Pressed or Not
- Once all keys are open, the microcontroller starts scanning the rows and columns to detect the key that is being pressed.
- The microcontroller scans the rows and columns one by one, starting from the first row and first column.
- For each row and column combination, the microcontroller checks whether a key is pressed or not.
- This is done by checking the logic level of the corresponding pin.
- If the pin is low (i.e., logic level 0), it means that a key is pressed at that particular row and column combination.
All of the Mentioned
- The process of detecting the key in a 4*4 keyboard matrix involves all the above-mentioned steps.
- Masking of bits is used to select a particular row or column.
- Ensuring that initially all keys are open is important to avoid any false detection.
- Checking whether the key is actually pressed or not is the main step in detecting the key.
- Therefore, option 'D' is the correct answer.
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).