Technology Sharing

【Study Notes】4. Combinational Logic Circuits (Part 1)

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

  • Classification of digital circuits: combinational logic circuits and sequential logic circuits.
  • In this chapter we study combinational logic circuits.

4.1 Analysis of Combinational Logic Circuits

  • Given a logic circuit, determine its logical expression, list the truth table, obtain the simplified logical expression, and analyze it to obtain its function.

3-bit odd parity circuit

(1) As shown in the figure below.
insert image description here
(2) List the truth table

ABCZL
00000
00101
01011
01110
10011
10110
11000
11101

(3) AnalyzeOdd parity circuitFunction.

  • When C is 1, and there are 0 or 2 1s in AB (AB is the same, Z=0), (an odd number of 1s), L is 1.
  • When C is 0 and there is only one 1 in AB (AB is different, Z=1), (an odd number of 1s), L is 1.
  • That is, when an odd number of 1s appears in ABC, L is 1. When an even number of 1s appears in ABC, L is 0.

3-bit even parity circuit

(1) Based on the odd-parity circuit, adding an inverter at the output end can obtainEven parity circuit

3-bit inverted code circuit

  • As shown below.
    insert image description here
  • Logical expression.
    X = A X = A X=A
    Y = ( A ⋅ B ‾ ‾ ) ⋅ ( A ‾ ⋅ B ) ‾ ‾ = A ⋅ B ‾ + A ‾ ⋅ B Y = overline{(overline{A·overline{B}})·(overline{overline{A}·B)}}=A·overline{B}+overline{A}·B Y=(AB)(AB)=AB+AB
    Z = ( A ‾ ⋅ C ‾ ) ⋅ ( A ⋅ C ‾ ) ‾ ‾ = A ‾ ⋅ C + A ⋅ C ‾ Z=overline{(overline{overline{A}·C})·(overline{A·overline{C})}}=overline{A}·C+A·overline{C} Z=(AC)(AC)=AC+AC
  • Truth table.
ABCXYZ
000000
001001
010010
011011
100111
101110
110101
111100
  • Functional Analysis.
    (1) In the original code ABC, A is the sign bit, 0 represents a positive number, and 1 represents a negative number.
    (2) The two’s complement is XYZ, where X is the sign bit, which is the same as A.
    (3) When A=0, a positive number, YZ and BC are consistent.
    (4) When A=1 is a negative number, the sign bit remains unchanged and X=A, and YZ is the result of inverting BC.

4.2 Combinational Logic Circuit Design

  • Clarify logical functions, determine inputs and outputs, list truth tables, write logical expressions, simplify and transform logical expressions, and draw logic diagrams.

3-digit train arrival indicator light

  • need.
    (1) Using 2 inputsNAND Gate,inverter.
    (2) Indicator light No. 1, the indicator light for express trains entering the station. It has a high priority.
    (3) Indicator light No. 2, the indicator light for express trains entering the station. Medium priority.
    (4) Indicator light No. 3, slow train approaching station indicator light. Low priority.
    (5) Only one indicator light can be on at a time.

  • Define input and output variables.
    (1) Input signal, I 0 Express request, I 1 Direct express request, I 2 Slow train request I_0 Express request, I_1 Direct express request, I_2 Slow train requestI0Express request,I1Please ask immediately.I2Slow train request1 means there is a request to enter the station, and 0 means there is no request to enter the station.
    (2) Output signal, L 0 Express station indicator, L 1 Direct express station indicator, L 2 Slow train station indicator L_0 Express station indicator, L_1 Direct express station indicator, L_2 Slow train station indicatorL0Express arrival indicator light,L1Fast-track indicator light,L2Slow train approaching station indicator1 means the light is on, 0 means the light is off.

  • Truth table.

enterOutput
I_0I_1I_2L_0L_1L_2
000000
1XX100
01X010
001001
  • List logical expressions
    L 0 = I 0 L_0 = I_0 L0=I0
    L 1 = I 0 ‾ ⋅ I 1 L_1 = overline{I_0}·I_1 L1=I0I1
    L 2 = I 0 ‾ ⋅ I 1 ‾ ⋅ I 2 L_2 = overline{I_0}·overline{I_1}·I_2 L2=I0I1I2

  • Transform to the AND-NOT form as required.
    L 0 = I 0 L_0 = I_0 L0=I0
    L 1 = I 0 ‾ ⋅ I 1 ‾ ‾ L_1 = overline{overline{overline{I_0}·I_1}} L1=I0I1
    L 2 = I 0 ‾ ⋅ I 1 ‾ ‾ ‾ ⋅ I 2 ‾ ‾ L_2 =overline{overline{overline{overline{overline{I_0}·overline{I_1}}}·I_2}} L2=I0I1I2

  • Draw a logic diagram.
    (1) A 74HC00 chip, containing four 2-input CMOS NAND gates.
    (2) A 74HC04 chip contains 6 CMOS inverters.
    insert image description here

4-bit Gray code to natural binary code

  • need.
    (1) Any logic gate circuit can be used.
    (2) 4-bit Gray code, converted to natural binary code.

  • Define input and output variables.
    (1) Input variables, G 3 , G 2 , G 1 , G 0 G_3,G_2,G_1,G_0 G3,G2,G1,G0
    (2) Output variables, B 3 , B 2 , B 1 , B 0 B_3,B_2,B_1,B_0 B3,B2,B1,B0

  • List the truth table.

enterOutput
G_3G_2G_1G_0B_3B_2B_1B_0
00000000
00010001
00110010
00100011
01100100
01110101
01010110
01000111
11001000
11011001
11111010
11101011
10101100
10111101
10011110
10001111
  • Based on the truth table, draw the Karnaugh map.
    insert image description here
    insert image description here

  • Lists logical expressions.
    B 3 = G 3 B_3 = G_3 B3=G3
    B 2 = G 3 ‾ ⋅ G 2 + G 3 ⋅ G 2 ‾ = G 3 ⊕ G 2 B_2 = overline{G_3}·G_2 + G_3·overline{G_2}=G_3⊕G_2 B2=G3G2+G3G2=G3G2
    B 1 = G 3 ‾ G 2 G 1 ‾ + G 3 G 2 ‾ G 1 ‾ + G 3 ‾ G 2 ‾ G 1 + G 3 G 2 G 1 = ( G 3 G 2 ‾ + G 3 ‾ G 2 ) G 1 ‾ + ( G 3 G 2 ‾ + G 3 ‾ G 2 ) ‾ G 1 = G 3 ⊕ G 2 ⊕ G 1 B_1 = overline{G_3}G_2overline{G_1}+G_3overline{G_2}overline{G_1}+overline{G_3}overline{G_2}G_1+G_3G_2G_1=(G_3overline{G_2}+overline{G_3}G_2)overline{G_1}+overline{(G_3overline{G_2}+overline{G_3}G_2)}G_1=G_3⊕G_2⊕G_1 B1=G3G2G1+G3G2G1+G3G2G1+G3G2G1=(G3G2+G3G2)G1+(G3G2+G3G2)G1=G3G2G1
    B 0 = G 3 ⊕ G 2 ⊕ G 1 ⊕ G 0 B_0=G_3⊕G_2⊕G_1⊕G_0 B0=G3G2G1G0

  • Draw a logic diagram.
    insert image description here

4.3 Competition and Risk-Taking in Combinational Logic Circuits

  • In a combinational logic circuit, it takes a certain amount of time for a signal to pass through a logic gate.
  • The signal takes different transmission times when it passes through different paths (different levels of logic gates and different types of logic gates).
  • Competition: The phenomenon that the signals at multiple input terminals of a logic gate change in opposite directions at the same time and at different times is called "competition". (Who changes first and who changes later is the competition).
  • Hazard: The output interference narrow pulses generated by competition are called hazard.

4.3.1 Reasons for competitive risk-taking

  • The input signals do not arrive simultaneously, resulting in abnormally narrow pulses of short duration.
  • AND Gate
    insert image description here
  • OR Gate
    insert image description here

4.3.2 Methods to Eliminate Competitive Risk

1. Find and eliminate complementary multiplication terms

  • F = ( A + B ) ( A ‾ + C ) F = (A+B)(overline{A}+C) F=(A+B)(A+C)
  • When B=C=0, there will be A A ‾ Aoverline{A} AAProduct term.
  • Discover: A A ‾ Aoverline{A} AAProduct terms may lead to "competitive hazard".
    insert image description here
  • Complementary and multiplicative terms: A ⋅ A ‾ A·overline{A} AA
  • Elimination: F = ( A + B ) ( A ‾ + C ) = A A ‾ + A C + B A ‾ + B C = A C + B A ‾ + B C F = (A+B)(overline{A}+C)=Aoverline{A}+AC+Boverline{A}+BC=AC+Boverline{A}+BC F=(A+B)(A+C)=AA+AC+BA+BC=AC+BA+BCIn this way, there are no complementary items, and to a certain extent, competition and risk-taking are avoided.

insert image description here

2. Add product terms to avoid adding complementary terms

  • As mentioned above, F = A C + B A ‾ + B C F =AC+Boverline{A}+BC F=AC+BA+BC, when B=C=1, F = A + A ‾ + 1 = 1 F = A+overline{A}+1 =1 F=A+A+1=1The BC product term here = 1, which plays a role in avoiding the competition hazard of adding complementary terms.
  • according toCommonly used identities "or" operation(Section 2.1), A B + A ‾ C + B C = A B + A ‾ C AB + overline{A} C + BC = AB + overline{A} C AB+AC+BC=AB+AC
  • When encountering a logical function L = A C + B C ‾ L=AC + Boverline{C} L=AC+BCIn this form, we can add the product term A B AB AB
    insert image description here

3. Connect capacitor in parallel with the output

  • For slower working scenarios.
  • The capacitance value is 4~20pF. It plays the role of "smoothing" the dangerous narrow pulse.
  • Disadvantages: It will make the rising and falling edges of the output waveform slow down.

4.4 (Learning Focus) Some Typical Combinational Logic Integrated Circuits

  • Encoder, decoder, data selector, data distributor, numerical comparator, arithmetic/logic operation unit.

4.4.1 Encoder

1. Definition and working principle

  • Using a binary code to represent information with a specific meaning is called encoding.
  • A logic circuit with encoding function is called an encoder.
    insert image description here
(1) Ordinary decoder (4-line-2-line encoder)
  • 4 inputs I 0 I 1 I 2 I 3 I_0 I_1 I_2 I_3 I0I1I2I3, a high-level valid signal.
  • 2 outputs Y 1 Y 0 Y_1Y_0 Y1Y0
  • Premise: At any time, I 0 I 1 I 2 I 3 I_0 I_1 I_2 I_3 I0I1I2I3There can only be one value of 1. And there is a corresponding binary code Y 1 Y 0 Y_1Y_0 Y1Y0
  • As shown in the following table, except for the 4 combinations of values ​​of the 4 inputs, the outputs corresponding to the other 12 combinations are all 00.
I 0 I_0 I0 I 1 I_1 I1 I 2 I_2 I2 I 3 I_3 I3 Y 1 Y_1 Y1 Y 0 Y_0 Y0
100000
010001
001010
000111
  • Logical expressions and logic diagrams
    Y 1 = I 0 ‾ I 1 ‾ I 2 I 3 ‾ + I 0 ‾ I 1 ‾ I 2 ‾ I 3 Y_1 = overline{I_0}overline{I_1}I_2overline{I_3}+overline{I_0}overline{I_1}overline{I_2}I_3 Y1=I0I1I2I3+I0I1I2I3
    Y 0 = I 0 ‾ I 1 I 2 ‾ I 3 ‾ + I 0 ‾ I 1 ‾ I 2 ‾ I 3 Y_0 = overline{I_0}I_1overline{I_2}overline{I_3}+overline{I_0}overline{I_1}overline{I_2}I_3 Y0=I0I1I2I3+I0I1I2I3

insert image description here

  • Additional question: If more than 2 of the 4 inputs have the value 1 at the same time, the output will be incorrectly encoded.
    For example: I 2 = I 3 = 1 I_2=I_3=1 I2=I3=1hour, Y 1 Y 0 = 0 Y_1Y_0=0 Y1Y0=0
  • To address this issue, you can increase priorities and set priorities.
(2) Priority encoder
  • Based on the above, a truth table is listed.
I 0 I_0 I0 I 1 I_1 I1 I 2 I_2 I2 I 3 I_3 I3 Y 1 Y_1 Y1 Y 0 Y_0 Y0
100000
X10001
XX1010
XXX111
  • Logical expressions:
    Y 1 = I 2 I 3 ‾ + I 3 = I 2 + I 3 Y_1 = I_2overline{I_3}+I_3= I_2+I_3 Y1=I2I3+I3=I2+I3
    Y 0 = I 1 I 2 ‾ I 3 ‾ + I 3 = I 1 I 2 ‾ + I 3 Y_0 = I_1overline{I_2}overline{I_3}+I_3=I_1overline{I_2}+I_3 Y0=I1I2I3+I3=I1I2+I3

insert image description here

(3) Output value is valid
  • Additional question: When I 0 = 1 or I 0 = 1 I_0=1 or I_0=1I0=1orI0=1When, always Y 1 Y 0 = 0 Y_1Y_0=0 Y1Y0=0. Different inputs, same outputs, indistinguishableValid output 0 ( I 0 = 1 I_0=1 I0=1andInvalid output 0
  • To address this problem, we can add aOutput value is valid"The output flag value GS.
  • For example, the 8421BCD encoder below. The first and second rows of the truth table are both 0000, which means that ABCD is a valid code only when GS==1.
S 9 S_9 S9 S 8 S_8 S8 S 7 S_7 S7 S 6 S_6 S6 S 5 S_5 S5 S 4 S_4 S4 S 3 S_3 S3 S 2 S_2 S2 S 1 S_1 S1 S 0 S_0 S0 A A A B B B C C C D D D G S GS GS
111111111100000
111111111000001
111111110100011
111111101100101
111111011100111
111110111101001
111101111101011
111011111101101
110111111101111
101111111110001
011111111110011

2. Integrated circuit priority encoder

  • Typical: CD4532 priority encoder (discontinued)
    insert image description here

  • Priority encoder I 7 has the highest priority, and I 0 has the lowest priority. Priority encoder I_7 has the highest priority, and I_0 has the lowest priority.Priority encoderI7The highest priority,I0Lowest priority.

    • The encoder works only when EI=1.
    • When EI=0, the encoder is prohibited from working (output is all low level).
  • When EI=1, all inputs are low level and noLower priorityInput high level, then output 000. At this time, EO=1.

  • EO = 1 only when EI = 1 and all inputs are 0. Dedicated to cascading with the EI of another device.

  • When EI=1, at least one of the input terminals is high level 1, GS=1.

  • For specific logical expressions and logic block diagrams, please refer to the book.

EI Permitted Codes EI Permitted CodesEIAllow Encoding I 7 I_7 I7 I 6 I_6 I6 I 5 I_5 I5 I 4 I_4 I4 I 3 I_3 I3 I 2 I_2 I2 I 1 I_1 I1 I 0 I_0 I0 Y 2 Y_2 Y2 Y 1 Y_1 Y1 Y 0 Y_0 Y0 GS has input 1 GS has input 1GSWith input1 EO input all 0 EO input all 0EOInput Full0
0xxxxxxxx00000
11xxxxxxx11110
101xxxxxx11010
1001xxxxx10110
10001xxxx10010
100001xxx01110
1000001xx01010
10000001x00110
10000000100010
10000000000001

  • When EI 1 = 0, slice 1 is disabled. Y 2 Y 1 Y 0 = = 000, GS 1 = 0, EO 1 = 0. EI 0 = 0, slice 0 is also disabled. When EI_1=0, slice 1 is disabled. Y_2Y_1Y_0==000, GS_1=0, EO_1=0. EI_0=0, slice 0 is also disabled.whenEI1=0Time, piece1Disabled.Y2Y1Y0==000GS1=0EO1=0EI0=0,piece0is also disabled.

    • At this time, GS 0 = 0. L 3 L 2 L 1 L 0 = 0000. GS = GS 1 + GS 0 = 0, at this time GS_0 = 0. L_3L_2L_1L_0 = 0000. GS = GS_1+GS_0 = 0,at this timeGS0=0L3L2L1L0=0000GS=GS1+GS0=0,
    • This is an invalid encoding.
  • When EI 1 = 1, encoding is allowed for slice 1. If I 15 − I 8 = 000...000, then EO 1 = 1, and thus EI 0 = 1. Encoding is allowed for slice 0. It can be seen that the priority of encoding for slice 1 is higher than that of encoding for slice 0. When EI_1=1, encoding is allowed for slice 1. If I_{15} - I_8 = 000...000, then EO_1=1, and thus EI_0=1. Encoding is allowed for slice 0. It can be seen that the priority of encoding for slice 1 is higher than that of encoding for slice 0.whenEI1=1Time, piece1Encoding is allowed ifI15I8=000...000,at this timeEO1=1,therebyEI0=1.piece0Encoding is allowed.1Encoding takes precedence over slices0coding

    • At this time L 3 = GS 1 = 0 , L 2 = Y 2 1 + Y 2 0 = Y 2 0 , L 1 = Y 1 1 + Y 1 0 = Y 1 0 , L 0 = Y 0 1 + Y 0 0 = Y 0 0 At this time L_3=GS_1=0 , L2=Y2_1+Y2_0=Y2_0, L1=Y1_1+Y1_0=Y1_0, L0=Y0_1+Y0_0=Y0_0at this timeL3=GS1=0L2=Y21+Y20=Y20L1=Y11+Y10=Y10L0=Y01+Y00=Y00
    • The output code range is 0000 − 0111 The output code range is 0000-0111The output encoding range is00000111
  • When EI 1 = 1, encoding is allowed for slice 1. If I 15 − I 8 has at least one 1, then EO 1 = 0, thus EI 0 = 0, and encoding is prohibited for slice 0. When EI_1=1, encoding is allowed for slice 1. If I_{15} - I_8 has at least one 1, then EO_1=0, thus EI_0=0, and encoding is prohibited for slice 0.whenEI1=1Time, piece1Encoding is allowed ifI15I8at least one1,at this timeEO1=0,therebyEI0=0,piece0Encoding is prohibited.

    • At this time L 3 = GS 1 = 1, L 2 = Y 2 1 + Y 2 0 = Y 2 1, L 1 = Y 1 1 + Y 1 0 = Y 1 1, L 0 = Y 0 1 + Y 0 0 = Y 0 1 At this time L_3=GS_1=1, L2=Y2_1+Y2_0=Y2_1, L1=Y1_1+Y1_0=Y1_1, L0=Y0_1+Y0_0=Y0_1at this timeL3=GS1=1L2=Y21+Y20=Y21L1=Y11+Y10=Y11L0=Y01+Y00=Y01
    • The output encoding range is 1000 − 1111 The output encoding range is 1000-1111The output encoding range is10001111
EI 1 Allowed Encoding EI_1 Allowed EncodingEI1Allow Encoding EI 0 Allowed encoding EI_0 Allowed encodingEI0Allow Encoding I 15 I_{15} I15 I 14 I_{14} I14 I 13 I_{13} I13 I 12 I_{12} I12 I 11 I_{11} I11 I 10 I_{10} I10 I 9 I_{9} I9 I 8 I_8 I8 I 7 I_7 I7 I 6 I_6 I6 I 5 I_5 I5 I 4 I_4 I4 I 3 I_3 I3 I 2 I_2 I2 I 1 I_1 I1 I 0 I_0 I0 Y 2 1 Y2_1 Y21 Y 1 1 Y1_1 Y11 Y 0 1 Y0_1 Y01 Y 2 0 Y2_0 Y20 Y 1 0 Y1_0 Y10 Y 0 0 Y0_0 Y00 EO 1 input all 0 EO_1 input all 0EO1Input Full0 EO 0 Input all 0 EO_0 Input all 0EO0Input Full0 GS 1 has input 1 GS_1 has input 1GS1With input1 GS 0 has input 0 GS_0 has input 0GS0With input0 L 3 L_3 L3 L 2 L_2 L2 L 1 L_1 L1 L 0 L_0 L0
0 (slice 1 disabled) E I 0 = E O 1 = 0 EI_0=EO_1=0 EI0=EO1=0(Disabled for slice 0)xxxxxxxxxxxxxxxx00000000000000
101xxxxxxxxxxxxxxx111000001 (Chip 1 has input)01 L 3 = G S 1 L_3 =GS_1 L3=GS11 L 2 = Y 2 1 L_2 =Y2_1 L2=Y211 L 1 = Y 1 1 L_1 =Y1_1 L1=Y111 L 0 = Y 0 1 L_0 =Y0_1 L0=Y01
1001xxxxxxxxxxxxxx11000000101110
10001xxxxxxxxxxxxx10100000101101
100001xxxxxxxxxxxx10000000101100
1000001xxxxxxxxxxx01100000101011
10000001xxxxxxxxxx01000000101010
100000001xxxxxxxxx00100000101001
1000000001xxxxxxxx00000000101000
1 E I 0 = E O 1 = 1 EI_0=EO_1=1 EI0=EO1=1(Slice 0 working)000000001xxxxxxx0001111 (chip 1 input all 0)00 (chip 1 invalid code)10 L 3 = G S 1 L_3 =GS_1 L3=GS11 L 2 = Y 2 0 L_2 =Y2_0 L2=Y201 L 1 = Y 1 0 L_1 =Y1_0 L1=Y101 L 0 = Y 0 0 L_0 =Y0_0 L0=Y00
110000000001xxxxxx00011010010110
1100000000001xxxxx00011110010101
11000000000001xxxx00011110010100
110000000000001xxx00011110010011
1100000000000001xx00011110010010
11000000000000001x00011110010001
11000000000000000100011110010000
11000000000000000000011111 (chip 0 input all 0)00 (chip 0 invalid code)0000

4.4.2 Decoder

  • 138 decoder.
  • 151Data selector.

1. Definition and Function

  • There are two types of decoders:
    • Unique address decoder: Converts a series of codes into valid signals that correspond to each other. (For example, a computer decodes the address of a storage unit, converts the address code into a valid signal, and selects the corresponding storage unit)
    • Code Converter: Converts one code into another.
(1) Binary decoder
  • n input terminals
  • 2 n 2^n 2nOutput
  • 1 enable terminal
(2) 2-wire to 4-wire decoder
  • Output terminal, low level is effective
    insert image description here
  • Truth Table
enterOutput
/EA_1A_0/Y_3/Y_2/Y_1/Y_0
1. ProhibitionXX1111
0 Enable001110 Low effective
0 Enable01110 low effective1
0 Enable1010 Low effective11
0 Enable110 Low effective111
  • Logical expressions (NOT GateandNAND Gateexpression)

Y 0 ‾ = E ‾ ‾ ⋅ A 1 ‾ ⋅ A 0 ‾ ‾ overline{Y_0} = overline{overline{overline{E}}·overline{A_1}·overline{A_0}} Y0=EA1A0 //00
Y 1 ‾ = E ‾ ‾ ⋅ A 1 ‾ ⋅ A 0 ‾ overline{Y_1} = overline{overline{overline{E}}·overline{A_1}·A_0} Y1=EA1A0 //01
Y 2 ‾ = E ‾ ‾ ⋅ A 1 ⋅ A 0 ‾ ‾ overline{Y_2} = overline{overline{overline{E}}·A_1·overline{A_0}} Y2=EA1A0 //10
Y 3 ‾ = E ‾ ‾ ⋅ A 1 ⋅ A 0 ‾ overline{Y_3} = overline{overline{overline{E}}·A_1·A_0} Y3=EA1A0 //11

  • Logic diagram of 2-wire to 4-wire decoder
    insert image description here

2. Integrated circuit decoder

(1) Binary decoder
2-wire to 4-wire decoder x2
  • 74x139 represents the CMOS type 74HC139 or the TTL type 74LS139.
  • 74x139yes"Dual 2-wire to 4-wire decoder”。
  • Two independent decoders are packaged in one integrated chip. (See above for details)
    insert image description here
3-line to 8-line decoder
  • 74x138 represents the CMOS type 74HC138 or the TTL type 74LS138.
  • 74x138yes3-line to 8-line decoder
  • use3-line to 8-line decoderCan be composed4-line to 16-line decoder5-line to 32-line decoder6-line to 64-line decoder
  • when E 3 = 1 , E 2 ‾ = E 1 ‾ = 0 E_3=1,overline{E_2}=overline{E_1}=0 E3=1,E2=E1=0The decoder is in working state.

insert image description here

  • Following the previous text, the logical expression of "3-line to 8-line decoder" can be derived.

Y 0 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ‾ ⋅ A 0 ‾ ‾ overline{Y_0} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·overline{A_1}·overline{A_0}} Y0=E3E2E1A2A1A0 //000
Y 1 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ‾ ⋅ A 0 ‾ overline{Y_1} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·overline{A_1}·A_0} Y1=E3E2E1A2A1A0 //001
Y 2 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ⋅ A 0 ‾ ‾ overline{Y_2} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·A_1·overline{A_0}} Y2=E3E2E1A2A1A0 //010
Y 3 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ⋅ A 0 ‾ overline{Y_3} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·A_1·A_0} Y3=E3E2E1A2A1A0 //011
Y 4 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ‾ ⋅ A 0 ‾ ‾ overline{Y_4} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·overline{A_1}·overline{A_0}} Y4=E3E2E1A2A1A0 //100
Y 5 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ‾ ⋅ A 0 ‾ overline{Y_5} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·overline{A_1}·A_0} Y5=E3E2E1A2A1A0 //101
Y 6 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ⋅ A 0 ‾ ‾ overline{Y_6} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·A_1·overline{A_0}} Y6=E3E2E1A2A1A0 //110
Y 7 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ⋅ A 0 ‾ overline{Y_7} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·A_1·A_0} Y7=E3E2E1A2A1A0 //111

5-line to 32-line decoder
  • Using 74x139 and 74x138 to form a "5-line to 32-line decoder"
    insert image description here
3-wire to 8-wire decoder to implement logic functions
  • The logic function is L = A ‾ ⋅ C ‾ + A ⋅ B L=overline{A}·overline{C}+A·B L=AC+AB
  • The inputs of the 3-line to 8-line decoder can be defined as A, B, and C.
  • The output of the 3-line to 8-line decoder is actually an 8-line output corresponding to the various minimum terms of A, B, and C.
  • For any ABC combination, only one output will be at a valid level.
  • L is actually a collection of several combinations of A, B, and C.

L = A ‾ ⋅ C ‾ + A ⋅ B = A ‾ ⋅ B ‾ ⋅ C ‾ + A ‾ ⋅ B ⋅ C ‾ + A ⋅ B ⋅ C ‾ + A B C = m 0 + m 2 + m 6 + m 7 L=overline{A}·overline{C}+A·B =overline{A}·overline{B}·overline{C}+overline{A}·B·overline{C} + A·B·overline{C}+ABC = m_0+m_2+m_6+m_7 L=AC+AB=ABC+ABC+ABC+ABC=m0+m2+m6+m7

Y 0 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ‾ ⋅ A 0 ‾ ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 0 ‾ overline{Y_0} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·overline{A_1}·overline{A_0}} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_0} Y0=E3E2E1A2A1A0=E3E2E1m0 //000
Y 1 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ‾ ⋅ A 0 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 1 ‾ overline{Y_1} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·overline{A_1}·A_0} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_1} Y1=E3E2E1A2A1A0=E3E2E1m1 //001
Y 2 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ⋅ A 0 ‾ ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 2 ‾ overline{Y_2} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·A_1·overline{A_0}}= overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_2} Y2=E3E2E1A2A1A0=E3E2E1m2 //010
Y 3 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ⋅ A 0 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 3 ‾ overline{Y_3} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·A_1·A_0}= overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_3} Y3=E3E2E1A2A1A0=E3E2E1m3 //011
Y 4 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ‾ ⋅ A 0 ‾ ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 4 ‾ overline{Y_4} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·overline{A_1}·overline{A_0}}= overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_4} Y4=E3E2E1A2A1A0=E3E2E1m4 //100
Y 5 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ‾ ⋅ A 0 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 5 ‾ overline{Y_5} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·overline{A_1}·A_0}= overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_5} Y5=E3E2E1A2A1A0=E3E2E1m5 //101
Y 6 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ⋅ A 0 ‾ ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 6 ‾ overline{Y_6} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·A_1·overline{A_0}}= overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_6} Y6=E3E2E1A2A1A0=E3E2E1m6 //110
Y 7 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ⋅ A 1 ⋅ A 0 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ m 7 ‾ overline{Y_7} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·A_2·A_1·A_0}= overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·m_7} Y7=E3E2E1A2A1A0=E3E2E1m7 //111

  • Ensure E 3 = 1 , E 2 = 0 , E 1 = 0 Ensure E_3=1,E_2=0,E_1=0make sureE3=1,E2=0,E1=0, that is to say Y 0 ‾ = m 0 ‾ , Y 2 ‾ = m 2 ‾ , Y 6 ‾ = m 6 ‾ , Y 7 ‾ = m 7 ‾ overline{Y_0}=overline{m_0},overline{Y_2}=overline{m_2},overline{Y_6}=overline{m_6},overline{Y_7}=overline{m_7} Y0=m0Y2=m2Y6=m6Y7=m7

  • Transformation of the logistic function according to the inversion law
    L = L ‾ ‾ = m 0 + m 2 + m 6 + m 7 ‾ ‾ = m 0 ‾ ⋅ m 2 ‾ ⋅ m 6 ‾ ⋅ m 7 ‾ ‾ = m 0 + m 2 + m 6 + m 7 ‾ ‾ = Y 0 ‾ ⋅ Y 2 ‾ ⋅ Y 6 ‾ ⋅ Y 7 ‾ ‾ L=overline{overline{L}} = overline{overline{m_0+m_2+m_6+m_7}} = overline{overline{m_0}·overline{m_2}·overline{m_6}·overline{m_7}} = overline{overline{m_0+m_2+m_6+m_7}} = overline{overline{Y_0}·overline{Y_2}·overline{Y_6}·overline{Y_7}} L=L=m0+m2+m6+m7=m0m2m6m7=m0+m2+m6+m7=Y0Y2Y6Y7

  • Get the logic diagram
    insert image description here

(2) Binary-to-decimal decoder
  • 774HC42

  • 4 input ports

  • 10 output terminals, output low level is valid, corresponding to decimal numbers 0~9.
    insert image description here

  • 4 input terminals, 16 conditions in total

  • only m 0 , m 1 , m 2 . . . . . . m 9 m_0 ,m_1,m_2......m_9 m0,m1,m2......m9It is a valid input (the corresponding output pin outputs low 0, and the rest output high 1).

  • The remaining 6 m 10 , m 11 , m 12 . . . . . . m 15 m_{10} ,m_{11},m_{12}......m_{15} m10,m11,m12......m15There is no valid decoding output (when invalid, all outputs are high 1).

  • Draw the input and output waveforms of 74HC42.

insert image description here

  • If DCBA inputs 0000-1001 in a loop, Y 0 ‾ to Y 9 ‾ overline{Y_0} to overline{Y_9}Y0arriveY9The upper cycle outputs a "sequential pulse signal".
  • The decoder can be constructedSequential pulseGenerate circuit.
    insert image description here
(3) Seven-segment display decoder
  • Digital tube display principle
    insert image description here

  • Integrated seven-segment display decoder. 74HC4511 (common cathode) (high level lights up)

  • L E LE LELatch Enable

  • L T ‾ overline{LT} LTLamp test input, when L T ‾ = 0 overline{LT}=0 LT=0When , ag outputs all 1s and displays the character "8".

  • B L ‾ overline{BL} BLLight off input, when LT ‾ = 1, and BL ‾ = 1 overline{LT}=1, and overline{BL}=1LT=1,andBL=1When , ag outputs all 0. It can be used to turn off unnecessary displayed zero "0".
    insert image description here

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0000, the corresponding output character is "0"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0001, the corresponding output character is "1"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0010, the corresponding output font is "2"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0011, the corresponding output character is "3"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0100, the corresponding output font is "4"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0101, the corresponding output character is "5"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0110, the corresponding output character is "6"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=0111, the corresponding output character is "7"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=1000, the corresponding output font is "8"

  • D 3 D 2 D 1 D 0 D_3D_2D_1D_0 D3D2D1D0=1001, the corresponding output font is "9"

  • 1010-1111, off

3. Data Allocator

  • One to many, send the data of the public data line to different channels as needed.

  • Similar to "SPMT switch"

  • Using unique address decoder to implement data distributor

  • For example, 74x138 integrates a 3-line to 8-line decoder.

  • E 1 – as data input overline{E_1} as data inputE1As data input

  • Y 0 Y 1 Y 2 Y 3 Y 4 Y 5 Y 6 Y 7 Y_0 Y_1 Y_2Y_3Y_4Y_5Y_6Y_7 Y0Y1Y2Y3Y4Y5Y6Y78 channels as data output
    insert image description here

  • Y 2 ‾ = E 3 ⋅ E 2 ‾ ‾ ⋅ E 1 ‾ ‾ ⋅ A 2 ‾ ⋅ A 1 ⋅ A 0 ‾ ‾ overline{Y_2} = overline{E_3·overline{overline{E_2}}·overline{overline{E_1}}·overline{A_2}·A_1·overline{A_0}} Y2=E3E2E1A2A1A0 //010

  • Above, E 3 = 1 , E 2 ‾ = 0 E_3=1,overline{E_2}=0 E3=1E2=0, when the address line A 2 A 1 A 0 = 010 A_2A_1A_0=010 A2A1A0=010hour, Y 2 ‾ = E 1 ‾ overline{Y_2}=overline{E_1} Y2=E1

  • Similarly, we can conclude that:
    When the address line A 2 A 1 A 0 = 000 A_2A_1A_0=000 A2A1A0=000hour, Y 0 ‾ = E 1 ‾ = D overline{Y_0}=overline{E_1}=D Y0=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 001 A_2A_1A_0=001 A2A1A0=001hour, Y 1 ‾ = E 1 ‾ = D overline{Y_1}=overline{E_1}=D Y1=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 010 A_2A_1A_0=010 A2A1A0=010hour, Y 2 ‾ = E 1 ‾ = D overline{Y_2}=overline{E_1}=D Y2=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 011 A_2A_1A_0=011 A2A1A0=011hour, Y 3 ‾ = E 1 ‾ = D overline{Y_3}=overline{E_1}=D Y3=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 100 A_2A_1A_0=100 A2A1A0=100hour, Y 4 ‾ = E 1 ‾ = D overline{Y_4}=overline{E_1}=D Y4=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 101 A_2A_1A_0=101 A2A1A0=101hour, Y 5 ‾ = E 1 ‾ = D overline{Y_5}=overline{E_1}=D Y5=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 110 A_2A_1A_0=110 A2A1A0=110hour, Y 6 ‾ = E 1 ‾ = D overline{Y_6}=overline{E_1}=D Y6=E1=D,other Y x = 1 Y_x=1 Yx=1
    When the address line A 2 A 1 A 0 = 111 A_2A_1A_0=111 A2A1A0=111hour, Y 7 ‾ = E 1 ‾ = D overline{Y_7}=overline{E_1}=D Y7=E1=D,other Y x = 1 Y_x=1 Yx=1

4.4.3 Data Selector

1. Definition and Function

  • This has the opposite function to the "data distributor" in 4.4.2.3 above.
  • More to one.
  • For example, a 4-to-1 data selector.
    insert image description here
  • E ‾ = 0 overline{E}=0 E=0, allowed to work.
  • when S 1 = 0 , S 0 = 0 S_1=0,S_0=0 S1=0S0=0hour, Y = I 0 Y=I_0 Y=I0
  • when S 1 = 0 , S 0 = 1 S_1=0,S_0=1 S1=0S0=1hour, Y = I 1 Y=I_1 Y=I1
  • when S 1 = 1 , S 0 = 0 S_1=1,S_0=0 S1=1S0=0hour, Y = I 2 Y=I_2 Y=I2
  • when S 1 = 1 , S 0 = 1 S_1=1,S_0=1 S1=1S0=1hour, Y = I 3 Y=I_3 Y=I3

2. Integrated circuit data selector

  • 74x151: One-to-8-to-1 data selector. Corresponds to CMOS type 74HC151, TTL type 74LS151.
  • 74x153: Dual 4-to-1 data selector. Corresponds to CMOS type 74HC153, TTL type 74LS153.
  • 74x157: Quad-2-to-1 data selector. Corresponds to CMOS type 74HC157, TTL type 74LS157.
  • 74x251: With three-state output, when E ‾ = 1 overline{E}=1 E=1When the chip output is high impedance.Line and”。
  • 74x253: With three-state output, when E ‾ = 1 overline{E}=1 E=1When the chip output is high impedance.Line and”。
  • 74x257: With three-state output, when E ‾ = 1 overline{E}=1 E=1When the chip output is high impedance.Line and”。
(1)74HC151

Y = S 2 ‾ ⋅ S 1 ‾ ⋅ S 0 ‾ ⋅ D 0 + S 2 ‾ ⋅ S 1 ‾ ⋅ S 0 ⋅ D 1 + S 2 ‾ ⋅ S 1 ⋅ S 0 ‾ ⋅ D 2 + S 2 ‾ ⋅ S 1 ⋅ S 0 ⋅ D 3 + S 2 ⋅ S 1 ‾ ⋅ S 0 ‾ ⋅ D 4 + S 2 ⋅ S 1 ‾ ⋅ S 0 ⋅ D 5 + S 2 ⋅ S 1 ⋅ S 0 ‾ ⋅ D 6 + S 2 ⋅ S 1 ⋅ S 0 ⋅ D 7 Y=overline{S_2}·overline{S_1}·overline{S_0}·D_0 +overline{S_2}·overline{S_1}·S_0·D_1 +overline{S_2}·S_1·overline{S_0}·D_2 +overline{S_2}·S_1·S_0·D_3 +S_2·overline{S_1}·overline{S_0}·D_4 +S_2·overline{S_1}·S_0·D_5 +S_2·S_1·overline{S_0}·D_6 +S_2·S_1·S_0·D_7 Y=S2S1S0D0+S2S1S0D1+S2S1S0D2+S2S1S0D3+S2S1S0D4+S2S1S0D5+S2S1S0D6+S2S1S0D7
insert image description here

(2) Application of data selector
  • Extensions to data selectors.

    • Output bit expansion ( Y 0 − > Y 1 Y 0 Y_0->Y_1Y_0 Y0>Y1Y0)
    • Input digit expansion ( D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 − > D 15 D 14 D 13 D 12 D 11 D 10 D 9 D 8 D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 D_7D_6D_5D_4D_3D_2D_1D_0->D_{15}D_{14}D_{13}D_{12}D_{11}D_{10}D_{9}D_{8}D_7D_6D_5D_4D_3D_2D_1D_0 D7D6D5D4D3D2D1D0>D15D14D13D12D11D10D9D8D7D6D5D4D3D2D1D0)。
  • Logical Function Generator

    • Known, 8 to 1 data selector.
      Y = S 2 ‾ ⋅ S 1 ‾ ⋅ S 0 ‾ ⋅ D 0 + S 2 ‾ ⋅ S 1 ‾ ⋅ S 0 ⋅ D 1 + S 2 ‾ ⋅ S 1 ⋅ S 0 ‾ ⋅ D 2 + S 2 ‾ ⋅ S 1 ⋅ S 0 ⋅ D 3 + S 2 ⋅ S 1 ‾ ⋅ S 0 ‾ ⋅ D 4 + S 2 ⋅ S 1 ‾ ⋅ S 0 ⋅ D 5 + S 2 ⋅ S 1 ⋅ S 0 ‾ ⋅ D 6 + S 2 ⋅ S 1 ⋅ S 0 ⋅ D 7 Y=overline{S_2}·overline{S_1}·overline{S_0}·D_0 +overline{S_2}·overline{S_1}·S_0·D_1 +overline{S_2}·S_1·overline{S_0}·D_2 +overline{S_2}·S_1·S_0·D_3 +S_2·overline{S_1}·overline{S_0}·D_4 +S_2·overline{S_1}·S_0·D_5 +S_2·S_1·overline{S_0}·D_6 +S_2·S_1·S_0·D_7 Y=S2S1S0D0+S2S1S0D1+S2S1S0D2+S2S1S0D3+S2S1S0D4+S2S1S0D5+S2S1S0D6+S2S1S0D7

    • Y = m 0 ⋅ D 0 + m 1 ⋅ D 1 + m 2 ⋅ D 2 + m 3 ⋅ D 3 + m 4 ⋅ D 4 + m 5 ⋅ D 5 + m 6 ⋅ D 6 + m 7 ⋅ D 7 Y=m_0·D_0 +m_1·D_1 +m_2·D_2 +m_3·D_3 +m_4·D_4 +m_5·D_5 +m_6·D_6 +m_7·D_7 Y=m0D0+m1D1+m2D2+m3D3+m4D4+m5D5+m6D6+m7D7

    • Logical functions L = A ‾ B C + A B ‾ C + A B L=overline{A}BC+Aoverline{B}C+AB L=ABC+ABC+AB
      L = A ‾ B C + A B ‾ C + A B = A ‾ B C + A B ‾ C + A B C ‾ + A B C = m 3 + m 5 + m 6 + m 7 L=overline{A}BC+Aoverline{B}C+AB=overline{A}BC+Aoverline{B}C+ABoverline{C}+ABC=m_3+m_5+m_6+m_7 L=ABC+ABC+AB=ABC+ABC+ABC+ABC=m3+m5+m6+m7

    • Use 8 to 1 data selector to implement the above function L
      L = Y = m 3 + m 5 + m 6 + m 7 , where D 7 D 6 D 5 D 3 = 1111 , D 4 D 2 D 1 D 0 = 0000 L = Y = m_3+m_5+m_6+m_7 , where D_7D_6D_5D_3=1111 , D_4D_2D_1D_0=0000L=Y=m3+m5+m6+m7,inD7D6D5D3=1111D4D2D1D0=0000
      insert image description here

  • Parallel data to serial data
    insert image description here

4.4.4 Numeric Comparator

1. Definition and Function

  • Compare the size of two numbers.
(1) 1-bit numerical comparator
  • List the truth table
AB F A > B F_{A>B} FA>B F A < B F_{A<B} FA<B F A = = B F_{A==B} FA==B
00001
01010
10100
11001
  • Logical expressions
    • F A > B = A ⋅ B ‾ F_{A>B} = A·overline{B} FA>B=AB
    • F A < B = A ‾ ⋅ B F_{A<B} = overline{A}·B FA<B=AB
    • F A = = B = A ⋅ B + A ‾ ⋅ B ‾ F_{A==B} = A·B+overline{A}·overline{B} FA==B=AB+AB
  • Logic diagram
    insert image description here
(2) 2-bit numerical comparator
  • List the truth table
A 1 ? B 1 A _1?B_1 A1B1 A 0 ? B 0 A_0?B_0 A0?B0 F A > B F_{A>B} FA>B F A < B F_{A<B} FA<B F A = = B F_{A==B} FA==B
A 1 > B 1 A_1>B_1 A1>B1x100
A 1 < B 1 A_1<B_1 A1<B1x010
A 1 = = B 1 A_1==B_1 A1==B1 A 0 > B 0 A_0>B_0 A0>B0100
A 1 = = B 1 A_1==B_1 A1==B1 A 0 < B 0 A_0<B_0 A0<B0010
A 1 = = B 1 A_1==B_1 A1==B1 A 0 = = B 0 A_0==B_0 A0==B0001
  • Logical expressions
    F A > B = F A 1 > B 1 + F A 1 = = B 1 ⋅ F A 0 > B 0 F_{A>B} = F_{A_1>B_1} +F_{A_1==B_1}·F_{A_0>B_0} FA>B=FA1>B1+FA1==B1FA0>B0
    F A < B = F A 1 < B 1 + F A 1 = = B 1 ⋅ F A 0 < B 0 F_{A<B} = F_{A_1<B_1} +F_{A_1==B_1}·F_{A_0<B_0} FA<B=FA1<B1+FA1==B1FA0<B0
    F A = = B = F A 1 = = B 1 ⋅ F A 0 = = B 0 F_{A==B} = F_{A_1==B_1}·F_{A_0==B_0} FA==B=FA1==B1FA0==B0

  • Logic diagram
    insert image description here

2. Integrated numerical comparator

  • 74x85, 4-bit numerical comparator. (CMOS type 74HC85)
  • 74x682, 8-bit numerical comparator.
(1) Functions of 74HC85
  • I A > B 、 I A = B 、 I A < B I_{A>B}、I_{A=B}、I_{A<B} IA>BIA=BIA<BIt is the extended input terminal. When the 4-bit input AB is equal, the size of AB is determined based on the extended input terminal.
    insert image description here
  • You can write logical expressions by listing the truth table.
(2) Expansion of the number of bits of numerical comparator
  • Connect in series to expand to 8-bit value comparator
    insert image description here

  • Connect in parallel and expand to a 16-bit numerical comparator.

  • When connected in parallel, the speed is fast.
    insert image description here

The article is limited in length. Please refer to "【Study Notes】4. Combinational Logic Circuits (Part 2)" for the follow-up.