



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Function: sets exactly one of n outputs to 1, based on unsigned binary value Input: ceil (lg n) Output: n bits (exactly one is 1, rest are 0)
Example: 3-8 decoder Inputs: 3 bits representing UB number Output: 1 bit corresponding to the value of the UB number is set to 1
Black box: z (^0) x 0 z (^1) z (^2) x 1 z (^3) z (^4) x 2 z (^5) z (^6) z (^7)
Truth table:
x 2 x 1 x 0 z 7 z 6 z 5 z 4 z 3 z 2 z 1 z (^0) 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0
Boolean expressions for each output: z 0 = \x 2 \x 1 \x 0 z 4 = x 2 \x 1 \x (^0) z 1 = \x 2 \x 1 x 0 z 5 = x 2 \x 1 x (^0) z 2 = \x 2 x 1 \x 0 z 6 = x 2 x 1 \x (^0) z 3 = \x 2 x 1 x 0 z 7 = x 2 x 1 x (^0)
Encoder is reverse of decoder 8-3 encoder 8 inputs, exactly one has value 1 3 output bits, representing which input was equal to 1 (binary representation of input) Example: input: x 5 = 1 output: z 2 z 1 z 0 = 101
Simplified truth table: Input == 1 z^2 z^1 z^0 x 0 0 0 0 Minterms are rather large x 1 0 0 1 (from full truth table): x 2 0 1 0 z 2 = \x 0 \x 1 \x 2 \x 3 x 4 \x 5 \x 6 \x 7 + x 3 0 1 1 \x 0 \x 1 \x 2 \x 3 \x 4 x 5 \x 6 \x 7 + x 4 1 0 0 \x 0 \x 1 \x 2 \x 3 \x 4 \x 5 x 6 \x 7 + x 5 1 0 1 \x 0 \x 1 \x 2 \x 3 \x 4 \x 5 \x 6 x (^7) x 6 1 1 0 x 7 1 1 1 However, we can take advantage of the fact that exactly one input is 1: z 2 = x 4 + x 5 + x 6 + x 7 Example: x 5 = 1 z 1 = x 2 + x 3 + x 6 + x 7 z 2 z 1 z 0 = 101 z 0 = x 1 + x 3 + x 5 + x 7 (UB for 5)
We can't always assume that only one input will be 1. Priority encoder: assumes that at least one input will be 1.
Which input to encode? Use priority scheme Larger subscripts could have higher priority Smaller subscripts could have higher priority Assume larger subscripts have priority Boolean expressions no longer necessarily valid Suppose x 4 and x 3 are both equal to 1 Then z 2 z 1 z 0 = 111 , but the result should be 100 , since 4 has higher priority What does it mean that 4 has the highest priority? All of the higher inputs must be 0, and the lower inputs don't matter: \x 7 \x 6 \x 5 x (^4) Negate all literals with higher priority, and leave out lower ones Replace each term in original expressions z 2 = x 7 + \x 7 x 6 + \x 7 \x 6 x 5 + \x 7 \x 6 \x 5 x (^4) z 1 = x 7 + \x 7 x 6 + \x 7 \x 6 \x 5 \x 4 x 3 + \x 7 \x 6 \x 5 \x 4 \x 3 x (^2) z 0 = x 7 + \x 7 \x 6 x 5 + \x 7 \x 6 \x 5 \x 4 x 3 + \x 7 \x 6 \x 5 \x 4 \x 3 \x 2 x (^1) This can be further simplified. If x 7 is the highest priority 1, then it doesn't matter if the other terms are 0 or not. z 2 = x 7 + x 6 + \x 6 x 5 + \x 6 \x 5 x (^4)
This document was created with Win2PDF available at http://www.daneprairie.com. The unregistered version of Win2PDF is for evaluation or non-commercial use only.