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 0. PE0 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 PE0,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 PE0,PE1,PE2 PE2 PE1 PE0 PB4 0 0 0 0 even number of 1’s 0 0 1 1 odd number of 1’s 0 1 0 1 odd number of 1’s 0 1 1 0 even number of 1’s 1 0 0 1 odd number of 1’s 1 0 1 0 even number of 1’s 1 1 0 0 even number of 1’s 1 1 1 1 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 IN c
Table:
PE2 PE1 PE0 PB4
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
This implies that odd number of set bit (input as 1) results
into output being 1 which points towards XOR gate.
bar(A) = negation of A. When you write answer, it can be
represented as shown in figure (with a line above A).
XOR(A,B) = (A+B).(bar(A) + bar(B))
C program:
#include<stdio.h>
void main() {
int PE2, PE1, PE0,i=0;
while(i<8){
printf("Enter PE2, PE1, PE0 (0 or
1) seperated by space:");
scanf("%d %d %d", &PE2,
&PE1, &PE0);
if ((PE0 !=0 && PE0 !=1)
||(PE1 !=0 && PE1 !=1) || (PE2 !=0 && PE2 !=1) )
{
printf("Please
input only 0 or 1");
continue;
}
printf("PB4:%d\n",PE2^PE1^PE0);
++i;
}
}
Output:
The objective of this system is to implement an odd-bit detection system. There are three bits...
Extra problem: Use the attached sheet to draw a 8- bit odd parity generator and a odd-parity checker for the 8 data bits and odd parity bit. Let the Error output be active-low (so that it goes low if there is an error and is high if there is no error) Parity Error-Detection System Using 74280s, design a complete parity generator/checking system. It is to be used in an 8-bit, even-parity computer configuration. Solution: Parity generator: Because the 74280 has...
computer architecture The sum of the two 32 bit integers may not be representable in 32 bits. In this case, we say that an overflow has occurred. Write MIPS instructions that adds two numbers stored in registers Ss1 and Ss2, stores the sum in register $s3, and sets register Sto to 1 if an overflow occurs and to 0 otherwise. 5. (16pts) 6. Show the IEEE 754 binary representation of the number -7.425 in a single and double 7. If...
Circuit Logic.Draw the contents of an ODD function for an input of 7 bits (i.e. it outputs ‘1’ if there are an odd number of inputs enabled (set 1) or it outputs ‘0’ if there are an even number of inputs enabled
2. Design an even parity detection circuit. A parity bit is an error checking mechanism. Your circuit will count the number of 1's in a stream of bits. If the number of l's is even, the circuit turns on an output called y. Assume a single bit at each cycle - call the input x. Do not use an accumulator or counter. Design the even parity detection circuit using J-K flip-flops. Your answer must include: a. The state diagram. b....
A logic circuit realizing the function f has four inputs A, B, C, and D. The three inputs A, B, and C are the binary representation of the digits 0 through 7 with A being the most-significant bit. The input D is an odd-parity bit, i.e., the value of D is such that A, B, C, and D always contain an odd number of 1’s. (For example, the digit 1 is represented by ABC = 001 and D = 0,...
Draw the contents of an EVEN function for an input of 7 bits (i.e. it outputs ‘1’ if there are an even number of inputs enabled (set 1) or it outputs ‘0’ if there are an odd number of inputs enabled:
Design a digital circuit that takes two 4-bit numbers A and B as input and generates output Z as follows: (20 points) - If A and B are odd numbers then Z-A-B. - If A and B are even numbers then Z-B-A 5. If A is an even number and B is an odd number then Z-A+B If A is an odd number and B is an even number then Z-A-B-1 Assume that you have access to as many as...
Design a sequential system that has one synchronous input bit stream x and one output z, with the following functionality and also follows the design constrains. Design Specifications: Design a sequential system that has one synchronous input bit stream X and one output Z, with the following functionality 1) We look at every fourth-input-bit, while the other input bits are "don't cares". when three "consecutives" fourth-bits form the sequences 110 or 000 the system should output Z = 1, meaning...
Implement a combination logic system that has two data inputs (A and B), one select input S, and one data output F. If S=0, then F=A, and if S=1, then F=B.
Problem 1. Capture the following system behavior as an HLSM. The system has two single-bit inputs U and D each coming from a button, and a 16-bit output C, which is initially 0. For each press of U, the systenm increments C.For each press of D, the system decrements C. If both buttons are pressed, the system does not change C. The system does not roll over; it goes no higher than the largest C and no lower than C...