Question: Using C and with the use logical and shift operations The objective of this system is to implement an odd-bit detection system. There are three
The objective of this system is to implement an odd-bit detection system. There are three bits of inputs and one bit of output. The output is in positive logic: outputing a 1 will turn on the LED, outputing a 0 will turn off the LED. Inputs are positive logic: meaning if the switch pressed is the input is 1, if the switch is not pressed the input is O. PEO is an input PE1 is an input PE2 is an input PB4 is the output The specific operation of this system Initialize Port E to make PEO,PE1,PE2 inputs and PB4 an output Over and over, read the inputs, calculate the result and set the output The input/output specification refers to the input, not the switch. The following table illustrates the expected behavior relative to output PB4 as a function of inputs PEO,PE1, PE2 PE2 PE1 PEO PB4 0 0 0 0 even number of 1's 0 0 11 odd number of 1's 0101 odd number of 1's O 110 even number of 1's 1 0 0 1 odd number of 1's 1010 even number of 1's 1100 even number of 1's 1111 odd number of 1's */ // NOTE: Do not use any conditional branches in your solution. // We want you to think of the solution in terms of logical and shift operations hOW TO DO THIS INC
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
