Top 10 Electrical & Hardware Engineer Questions
Real job-interview questions with full solutions. Filter, solve and prepare for your next interview.
A room has an entrance hallway through which only one person can pass at a time. The detector at the entrance has 5 possible outputs: A. A man enters the room - detector outputs '1000'. B. A man leaves the room - detector outputs '0100'. C. A woman enters the room - detector outputs '0010'. D. A woman leaves the room - detector outputs '0001'. E. No movement - detector outputs '0000'. Using this detector, design a system that indicates the ratio of men to women in the room using 3 LEDs: - Red: more women than men - Yellow: equal number of men and women - Green: more men than women
Given 4 registers r1, r2, r3, r4. Their initial state is described in the attached code snippet. The commands available to you are: dec, inc, jnz, jz. You need to implement multiplication between r1 and r2 into r4.
mov r1, a ; initialize r1 with a mov r2, b ; initialize r2 with b mov r3, 0 ; initialize r3 with 0 mov r4, 0 ; initialize r4 with 0Implement a logic component that outputs the squares of numbers sequentially, receiving new input on each rising edge of the clock, without using a multiplexer.
Input: 1,2,3,4,5,6,...,10,... Output: 1,4,9,16,25,36,...,100,...




