Segmento a de un display de siete segmentos desde BCD con indiferencias como supuestos
El segmento a de un display de siete segmentos, dado como Σm(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9) con el supuesto BCD de que los códigos 10 a 15 nunca ocurren. Seis indiferencias permiten al mapa derivar cuatro términos.
Las cuatro entradas son los bits de un dígito BCD: D es el bit 8, C el bit 4, B el bit 2 y A el bit 1. El segmento a, la barra superior, se enciende para los dígitos 0, 2, 3, 5, 6, 7, 8 y 9 y queda apagado para 1 y 4. La fórmula se escribe como esa lista de mintérminos. El supuesto k1, NOT (D AND (C OR B)), establece que los bits codifican un dígito de 0 a 9, así que los códigos 10 a 15 nunca ocurren. La tabla tiene dieciséis filas; la columna del supuesto es falsa en las seis últimas.
Las comprobaciones se ejecutan sobre la función completa: tautología violada con el contraejemplo D = FALSO, C = FALSO, B = FALSO, A = VERDADERO; satisfacible con las cuatro entradas en FALSO. El simplificador no encontró ninguna ley aplicable a una lista de mintérminos. El conversor la desarrolla en ocho términos y ocho cláusulas de cuatro literales, 32 literales cada una; los conversores de compuertas informan de 407 NAND y 719 NOR para ese desarrollo. El mapa de Karnaugh, con 6 indiferencias del supuesto, dibuja cuatro grupos, cuatro implicantes primos, y deriva D OR (NOT C AND NOT A) OR (C AND A) OR B, etiquetado como equivalente solo dentro de los supuestos.
Los decodificadores de siete segmentos son el ejercicio clásico de indiferencias porque el hardware de verdad nunca ve códigos por encima de 9. El mismo razonamiento vale para cualquier enumeración guardada en más bits de los que necesita. Lo que hay que vigilar es la etiqueta: la expresión derivada coincide con la lista de mintérminos solo en las diez filas BCD, y el motor lo dice en su anotación de alcance. Si un cambio posterior deja pasar el código 10, el decodificador acortado deja de estar garantizado, y la tabla completa de dieciséis filas es la única especificación segura.
D: bit 8; C: bit 4; B: bit 2; A: bit 1;
segment_a := Σm(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9) · salida
Supuestos: NOT (D AND (C OR B)) (The four bits encode a decimal digit 0 to 9 (BCD); codes 10 to 15 never occur.)
Comprobaciones exactas
Tabla de verdad (16 filas)
| # | D | C | B | A | segment_a | k1 | Ámbito |
|---|---|---|---|---|---|---|---|
| 0 | FALSO | FALSO | FALSO | FALSO | VERDADERO | VERDADERO | en ámbito |
| 1 | FALSO | FALSO | FALSO | VERDADERO | FALSO | VERDADERO | en ámbito |
| 2 | FALSO | FALSO | VERDADERO | FALSO | VERDADERO | VERDADERO | en ámbito |
| 3 | FALSO | FALSO | VERDADERO | VERDADERO | VERDADERO | VERDADERO | en ámbito |
| 4 | FALSO | VERDADERO | FALSO | FALSO | FALSO | VERDADERO | en ámbito |
| 5 | FALSO | VERDADERO | FALSO | VERDADERO | VERDADERO | VERDADERO | en ámbito |
| 6 | FALSO | VERDADERO | VERDADERO | FALSO | VERDADERO | VERDADERO | en ámbito |
| 7 | FALSO | VERDADERO | VERDADERO | VERDADERO | VERDADERO | VERDADERO | en ámbito |
| 8 | VERDADERO | FALSO | FALSO | FALSO | VERDADERO | VERDADERO | en ámbito |
| 9 | VERDADERO | FALSO | FALSO | VERDADERO | VERDADERO | VERDADERO | en ámbito |
| 10 | VERDADERO | FALSO | VERDADERO | FALSO | FALSO | FALSO | excluida |
| 11 | VERDADERO | FALSO | VERDADERO | VERDADERO | FALSO | FALSO | excluida |
| 12 | VERDADERO | VERDADERO | FALSO | FALSO | FALSO | FALSO | excluida |
| 13 | VERDADERO | VERDADERO | FALSO | VERDADERO | FALSO | FALSO | excluida |
| 14 | VERDADERO | VERDADERO | VERDADERO | FALSO | FALSO | FALSO | excluida |
| 15 | VERDADERO | VERDADERO | VERDADERO | VERDADERO | FALSO | FALSO | excluida |
Lectura en lenguaje claro
Principiantesegment_a es verdadero exactamente cuando la fila de la tabla de verdad de (D, C, B, A) es una de las filas 0, 2, 3, 5, 6, 7, 8 y 9.
En todos los demás casos, segment_a es falso.
Sobre los operadores:
- Σm enumera las filas de la tabla de verdad (mintérminos) en las que la fórmula es verdadera. Las filas se numeran desde 0 y la primera entrada indicada es el bit más significativo.
Intermediosegment_a es verdadero exactamente cuando la fila de la tabla de verdad de (D, C, B, A) es una de las filas 0, 2, 3, 5, 6, 7, 8 y 9.
En todos los demás casos, segment_a es falso.
Avanzadosegment_a es verdadero exactamente cuando la fila de la tabla de verdad de (D, C, B, A) es una de las filas 0, 2, 3, 5, 6, 7, 8 y 9 [suma canónica de mintérminos (FND)].
En todos los demás casos, segment_a es falso.
Notación formal: Σm(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9)
Diagrama lógico
Simplificación paso a paso
El motor no encontró ninguna ley que acorte esta expresión; ya es tan corta como sus leyes de reescritura permiten.
Σm(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9)
Mapa de Karnaugh
- celdas m8, m9, m10, m11, m12, m13, m14, m15
D - celdas m0, m2, m8, m10
NOT C AND NOT A - celdas m5, m7, m13, m15
C AND A - celdas m2, m3, m6, m7, m10, m11, m14, m15
B
6 cells excluded by the confirmed assumptions (k1) are marked don't-care. An expression derived with them is equivalent only within the assumptions.
Mintérminos y maxtérminos
segment_a(D, C, B, A) = Σm(0, 2, 3, 5, 6, 7, 8, 9)segment_a(D, C, B, A) = ΠM(1, 4, 10, 11, 12, 13, 14, 15)Orden de variables: D, C, B, A · 16 filas
Formas normales
Forma normal conjuntiva (FNC)
(D OR C OR B OR NOT A) AND (D OR NOT C OR B OR A) AND (NOT D OR C OR NOT B OR A) AND (NOT D OR C OR NOT B OR NOT A) AND (NOT D OR NOT C OR B OR A) AND (NOT D OR NOT C OR B OR NOT A) AND (NOT D OR NOT C OR NOT B OR A) AND (NOT D OR NOT C OR NOT B OR NOT A)8 cláusulas, 32 literales · complete · Desarrollo en mintérminos ×1
Forma normal disyuntiva (FND)
(D AND NOT C AND NOT B AND A) OR (D AND NOT C AND NOT B AND NOT A) OR (NOT D AND C AND B AND A) OR (NOT D AND C AND B AND NOT A) OR (NOT D AND C AND NOT B AND A) OR (NOT D AND NOT C AND B AND A) OR (NOT D AND NOT C AND B AND NOT A) OR (NOT D AND NOT C AND NOT B AND NOT A)8 términos, 32 literales · complete · Desarrollo en mintérminos ×1
Solo NAND, solo NOR
Forma solo con NAND
NAND(NAND(NAND(NAND(NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A))))), NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A)))))), NAND(NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, A), NAND(B, A))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A)))), NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, A), NAND(B, A))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A)))))), NAND(NAND(NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A))))), NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A)))))), NAND(NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, A), NAND(B, A))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A)))), NAND(NAND(NAND(NAND(NAND(D, D), NAND(C, C)), NAND(NAND(D, D), NAND(C, C))), NAND(NAND(B, A), NAND(B, A))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A))))))), NAND(NAND(NAND(NAND(NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, A), NAND(B, A)))), NAND(NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, A), NAND(B, A))))), NAND(NAND(NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A)))), NAND(NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A)))))), NAND(NAND(NAND(NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, A), NAND(B, A)))), NAND(NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, NAND(A, A)), NAND(B, NAND(A, A)))), NAND(NAND(NAND(NAND(D, D), C), NAND(NAND(D, D), C)), NAND(NAND(B, A), NAND(B, A))))), NAND(NAND(NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A)))), NAND(NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), NAND(A, A)), NAND(NAND(B, B), NAND(A, A)))), NAND(NAND(NAND(D, NAND(C, C)), NAND(D, NAND(C, C))), NAND(NAND(NAND(B, B), A), NAND(NAND(B, B), A))))))))407 compuertas · equivalencia verificada en todas las filas
Forma solo con NOR
NOR(NOR(NOR(NOR(NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A)))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))))), NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))))), NOR(NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A)))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))))), NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A)))))))), NOR(NOR(NOR(NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A))))), NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))))), NOR(NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))))), NOR(NOR(NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A))))), NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))))), NOR(NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))))))), NOR(NOR(NOR(NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A)))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))))), NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))))), NOR(NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A)))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))))), NOR(NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(D, C), NOR(D, C)), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A)))))))), NOR(NOR(NOR(NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A))))), NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))))), NOR(NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))))), NOR(NOR(NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A))))), NOR(NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), A), NOR(NOR(B, B), A))), NOR(NOR(NOR(D, NOR(C, C)), NOR(D, NOR(C, C))), NOR(NOR(NOR(B, B), NOR(A, A)), NOR(NOR(B, B), NOR(A, A)))))), NOR(NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))), NOR(NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, A), NOR(B, A))), NOR(NOR(NOR(NOR(D, D), C), NOR(NOR(D, D), C)), NOR(NOR(B, NOR(A, A)), NOR(B, NOR(A, A))))))))))719 compuertas · equivalencia verificada en todas las filas
La misma regla como código
Python
# -*- coding: utf-8 -*-
# Generated by Tangibool (tangibool.python/1). Do not edit by hand; regenerate from the source revision.
# Model: not stated
# Source revision: reference
# Interpretation status: not stated
"""Tangibool evaluator (decision model).
Generated deterministically from the validated Boolean model; it evaluates exactly that
model. It does not establish that the model is a complete, legal, or safe statement of a
real-world rule, and evaluating examples does not verify the rule.
Source revision: reference
Interpretation status: not stated
Exporter: 1.0.0 (format tangibool.python/1; engine 1.0.0; semantics tangibool-semantics/1)
Logic digest: fa0a837018d065810261a99bf9b01e2e337b932d2626d640db3cd91cd5f406dc
Assumptions digest: 358b5df2f94f91c39cac1783c9c1647a33fa8d02d2026300c71af6a6606a1a92
Inputs (dict keys, declared order) and generated parameter names:
'D' -> input_D
'C' -> input_C
'B' -> input_B
'A' -> input_A
Outputs (declared order) and their functions:
'segment_a' -> output_segment_a(inputs)
Assumptions (the declared scope, checked by in_scope(inputs)):
'k1': NOT (D AND (C OR B))
Input contract:
Every required input must be exactly True or False (type(value) is bool). Missing
inputs, None, strings, integers (including 0 and 1), and keys that are not declared
inputs raise InputError before anything is evaluated, including inputs that a
short-circuiting operator would never read. Results are always bool.
Scope:
Decision functions raise OutOfScopeError when the inputs violate an assumption; an
out-of-scope assignment is never turned into a False result. Pass check_scope=False
to evaluate without the scope check, and use in_scope(inputs) to test it separately.
Usage:
import tangibool_model as model
model.evaluate({'D': False, 'C': False, 'B': False, 'A': False})
# -> {'segment_a': True}
model.output_segment_a({'D': False, 'C': False, 'B': False, 'A': False})
# -> True
model.evaluate({'D': 1, 'C': False, 'B': False, 'A': False})
# raises InputError: 1 is an int, not a bool
"""
import collections.abc as _abc
from typing import Dict, Mapping, Tuple
__all__ = [
"MODEL_INFO",
"IDENTIFIER_MAP",
"INPUT_NAMES",
"OUTPUT_NAMES",
"ASSUMPTIONS",
"InputError",
"OutOfScopeError",
"minterm_index",
"in_scope",
"evaluate",
"output_segment_a",
"assumption_k1",
]
MODEL_INFO = {
"format": "tangibool.python/1",
"mode": "decision",
"model": None,
"revision": "reference",
"interpretation": None,
"exporter": "1.0.0",
"engine_version": "1.0.0",
"semantics_version": "tangibool-semantics/1",
"logic_digest": "fa0a837018d065810261a99bf9b01e2e337b932d2626d640db3cd91cd5f406dc",
"assumptions_digest": "358b5df2f94f91c39cac1783c9c1647a33fa8d02d2026300c71af6a6606a1a92",
"primary_output": "segment_a",
"unused_inputs": (),
"subcircuits": (),
}
# Stable ID -> generated identifier (reversible mapping; names are exact, escaped strings).
IDENTIFIER_MAP = {
"v_7da2abdb16e1": {"kind": "input", "name": "D", "identifier": "input_D"},
"v_564a2130f32e": {"kind": "input", "name": "C", "identifier": "input_C"},
"v_6de50780b905": {"kind": "input", "name": "B", "identifier": "input_B"},
"v_4270e4ecab98": {"kind": "input", "name": "A", "identifier": "input_A"},
"f_5b4b17b0dce7": {"kind": "output", "name": "segment_a", "identifier": "output_segment_a"},
"f_265ee8e74dc1": {"kind": "assumption", "name": "k1", "identifier": "assumption_k1"},
}
INPUT_NAMES = ("D", "C", "B", "A")
OUTPUT_NAMES = ("segment_a",)
ASSUMPTIONS = (
{"name": "k1", "id": "f_265ee8e74dc1", "formula": "NOT (D AND (C OR B))", "description": "The four bits encode a decimal digit 0 to 9 (BCD); codes 10 to 15 never occur."},
)
_DECLARED_INPUTS = frozenset(INPUT_NAMES)
_SCOPE_INPUTS = ("D", "C", "B")
_ASSUMPTION_FORMULAS = {entry["name"]: entry["formula"] for entry in ASSUMPTIONS}
class InputError(ValueError):
"""Raised when inputs are missing, undeclared, or not exactly True/False.
Every required input must satisfy type(value) is bool. Missing inputs, None, strings,
integers (including 0 and 1), and keys that are not declared inputs are rejected before
anything is evaluated. A missing input is never treated as False. The individual problems
are listed in the problems attribute.
"""
def __init__(self, problems):
self.problems = tuple(problems)
super().__init__("Invalid inputs: " + "; ".join(self.problems))
class OutOfScopeError(ValueError):
"""Raised when the inputs violate the model's assumptions (its declared scope).
Outside its assumptions the rule has no decision: this error is never a False result.
The names of the violated assumptions are in the violated attribute.
"""
def __init__(self, violated):
self.violated = tuple(violated)
details = ", ".join(name + " (" + _ASSUMPTION_FORMULAS.get(name, "?") + ")" for name in self.violated)
super().__init__(
"Out of scope: the inputs violate "
+ ("assumption " if len(self.violated) == 1 else "assumptions ")
+ details
+ ". The rule has no decision outside its assumptions; this is not a False result."
)
def _short_repr(value: object) -> str:
text = repr(value)
return text if len(text) <= 60 else text[:57] + "..."
def _checked_inputs(inputs: Mapping[str, bool], required: Tuple[str, ...], check_scope: bool) -> Dict[str, bool]:
"""Validate inputs strictly before anything is evaluated and return a plain copy."""
if type(check_scope) is not bool:
raise TypeError("check_scope must be True or False")
if not isinstance(inputs, _abc.Mapping):
raise InputError(["inputs must be a mapping from input names to True/False, got " + type(inputs).__name__])
problems = []
for key in inputs:
if type(key) is not str or key not in _DECLARED_INPUTS:
declared = ", ".join(repr(name) for name in INPUT_NAMES) or "none"
problems.append("undeclared input " + _short_repr(key) + " (declared inputs: " + declared + ")")
needed = tuple(required) + (_SCOPE_INPUTS if check_scope else ())
for name in needed:
if name not in inputs:
problems.append("missing required input " + repr(name))
for key, value in inputs.items():
if type(key) is str and key in _DECLARED_INPUTS and type(value) is not bool:
problems.append(
"input " + repr(key) + " must be True or False (type bool), got "
+ type(value).__name__ + " " + _short_repr(value)
)
if problems:
raise InputError(list(dict.fromkeys(problems)))
return dict(inputs.items())
def _require_bool_args(function: str, pairs: Tuple[Tuple[str, object], ...]) -> None:
problems = [
"argument " + repr(name) + " of " + function + " must be True or False (type bool), got "
+ type(value).__name__ + " " + _short_repr(value)
for name, value in pairs
if type(value) is not bool
]
if problems:
raise InputError(problems)
def minterm_index(*values: bool) -> int:
"""Row index of an assignment over a declared variable order.
The first value is the most significant bit, so all-False is row 0. Used for indexed
minterm (sum) and maxterm (product) forms.
"""
index = 0
for value in values:
if type(value) is not bool:
raise InputError(["minterm_index() takes True/False values, got " + type(value).__name__ + " " + _short_repr(value)])
index = index * 2 + (1 if value else 0)
return index
def _scope_values(values: Dict[str, bool]) -> Tuple[Tuple[str, bool], ...]:
"""Value of every enabled, confirmed assumption for validated inputs, in declared order."""
assumption_k1_value = _compute_assumption_k1(values["D"], values["C"], values["B"])
return (
("k1", assumption_k1_value),
)
def _require_in_scope(values: Dict[str, bool]) -> None:
violated = tuple(name for name, holds in _scope_values(values) if not holds)
if violated:
raise OutOfScopeError(violated)
def in_scope(inputs: Mapping[str, bool]) -> bool:
"""True when the inputs satisfy every assumption (the model's declared scope).
Requires the inputs the assumptions read; raises InputError for invalid inputs.
"""
values = _checked_inputs(inputs, (), True)
return all(holds for _, holds in _scope_values(values))
# ---- Formula bodies (inputs are validated by the public functions below) ----
def _compute_output_segment_a(input_D: bool, input_C: bool, input_B: bool, input_A: bool) -> bool:
"""Decision output 'segment_a': \u03a3m(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9)"""
return minterm_index(input_D, input_C, input_B, input_A) in (0, 2, 3, 5, 6, 7, 8, 9)
def _compute_assumption_k1(input_D: bool, input_C: bool, input_B: bool) -> bool:
"""Assumption 'k1': NOT (D AND (C OR B))"""
return not (input_D and (input_C or input_B))
# ---- Public API ----
def output_segment_a(inputs: Mapping[str, bool], *, check_scope: bool = True) -> bool:
"""Decision output 'segment_a' (stable ID f_5b4b17b0dce7).
'segment_a' := \u03a3m(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9)
Required inputs: 'D', 'C', 'B', 'A'; with check_scope=True also 'D', 'C', 'B' (read by the assumptions).
Raises InputError for missing, undeclared, or non-bool inputs, and OutOfScopeError
when check_scope is True and the inputs violate an assumption.
"""
values = _checked_inputs(inputs, ("D", "C", "B", "A"), check_scope)
if check_scope:
_require_in_scope(values)
output_segment_a_value = _compute_output_segment_a(values["D"], values["C"], values["B"], values["A"])
return output_segment_a_value
def evaluate(inputs: Mapping[str, bool], *, check_scope: bool = True) -> Dict[str, bool]:
"""Evaluate every output (declared order); each output is computed once.
Required inputs: 'D', 'C', 'B', 'A'; with check_scope=True also 'D', 'C', 'B' (read by the assumptions).
Raises InputError for missing, undeclared, or non-bool inputs, and OutOfScopeError
when check_scope is True and the inputs violate an assumption.
"""
values = _checked_inputs(inputs, ("D", "C", "B", "A"), check_scope)
if check_scope:
_require_in_scope(values)
output_segment_a_value = _compute_output_segment_a(values["D"], values["C"], values["B"], values["A"])
return {
"segment_a": output_segment_a_value,
}
def assumption_k1(inputs: Mapping[str, bool]) -> bool:
"""Assumption 'k1' (stable ID f_265ee8e74dc1).
'k1' := NOT (D AND (C OR B))
Description: The four bits encode a decimal digit 0 to 9 (BCD); codes 10 to 15 never occur.
Required inputs: 'D', 'C', 'B'.
Raises InputError for missing, undeclared, or non-bool inputs.
"""
values = _checked_inputs(inputs, ("D", "C", "B"), False)
assumption_k1_value = _compute_assumption_k1(values["D"], values["C"], values["B"])
return assumption_k1_value
PostgreSQL
-- Tangibool PostgreSQL export (tangibool.postgresql/1)
-- Target: PostgreSQL 16 or later with typed boolean inputs; tested with PostgreSQL 18.3 (PGlite 0.5.8).
-- Not a claim of compatibility with other SQL dialects.
-- Model: not stated
-- Source revision: reference
-- Interpretation status: not stated
-- Exporter: 1.0.0 (engine 1.0.0; semantics tangibool-semantics/1)
-- Logic digest: fa0a837018d065810261a99bf9b01e2e337b932d2626d640db3cd91cd5f406dc
-- Assumptions digest: 358b5df2f94f91c39cac1783c9c1647a33fa8d02d2026300c71af6a6606a1a92
-- Mode: decision
--
-- Read-only: this file contains only WITH / VALUES / SELECT statements. No DDL, DML,
-- procedures, credentials, network access, or database changes. The expressions are pure
-- Boolean expressions, so their result does not depend on SQL evaluation order.
--
-- NON-NULL INPUT PRECONDITION: NULL is not a truth value of this rule. Every fragment below
-- is defined only when every input column it reads is a non-NULL boolean. The guard template
-- (section 2) marks any NULL input as 'invalid_input' and any row that violates the
-- assumptions as 'out_of_scope', and fills output columns only for 'ok' rows; a NULL in an
-- output column of another row is an envelope marker, not a third truth value. Never wrap
-- the fragments in COALESCE(..., FALSE) or otherwise choose a meaning for unknown inputs.
-- This evaluates the supplied model; it does not show that the model is a complete, legal,
-- or safe statement of a real-world rule.
--
-- Input columns (stable ID: name -> column):
-- v_7da2abdb16e1: D -> "in_D"
-- v_564a2130f32e: C -> "in_C"
-- v_6de50780b905: B -> "in_B"
-- v_4270e4ecab98: A -> "in_A"
-- Output columns:
-- f_5b4b17b0dce7: segment_a -> "out_segment_a"
-- Assumptions (scope K; exported separately and never folded into an output):
-- f_265ee8e74dc1: k1 -> "assumption_k1": NOT (D AND (C OR B))
-- The four bits encode a decimal digit 0 to 9 (BCD); codes 10 to 15 never occur.
-- ----------------------------------------------------------------------------------------------
-- 1. Expression fragments (parenthesised; non-NULL boolean inputs required)
-- ----------------------------------------------------------------------------------------------
--
-- [out_segment_a] output segment_a (stable ID f_5b4b17b0dce7)
-- segment_a := \u03a3m(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9)
-- PRECONDITION: "in_D", "in_C", "in_B", "in_A" are non-NULL booleans.
-- (((NOT "in_D") AND (NOT "in_C") AND (NOT "in_B") AND (NOT "in_A")) OR ((NOT "in_D") AND (NOT "in_C") AND "in_B" AND (NOT "in_A")) OR ((NOT "in_D") AND (NOT "in_C") AND "in_B" AND "in_A") OR ((NOT "in_D") AND "in_C" AND (NOT "in_B") AND "in_A") OR ((NOT "in_D") AND "in_C" AND "in_B" AND (NOT "in_A")) OR ((NOT "in_D") AND "in_C" AND "in_B" AND "in_A") OR ("in_D" AND (NOT "in_C") AND (NOT "in_B") AND (NOT "in_A")) OR ("in_D" AND (NOT "in_C") AND (NOT "in_B") AND "in_A"))
--
-- [assumption_k1] assumption k1 (stable ID f_265ee8e74dc1)
-- k1 := NOT (D AND (C OR B))
-- PRECONDITION: "in_D", "in_C", "in_B" are non-NULL booleans.
-- (NOT ("in_D" AND ("in_C" OR "in_B")))
--
-- [K] scope (conjunction of the assumptions):
-- (NOT ("in_D" AND ("in_C" OR "in_B")))
--
-- ----------------------------------------------------------------------------------------------
-- 2. Guard template (read-only SELECT over an inputs list)
-- ----------------------------------------------------------------------------------------------
-- Replace the example rows between the markers with your own rows, or replace the inputs
-- CTE with a SELECT that provides the boolean columns listed in the header. status is
-- 'invalid_input' when any input is NULL, 'out_of_scope' when the assumptions are false, and
-- 'ok' otherwise; output columns are filled only for 'ok' rows (NULL elsewhere is an
-- envelope marker). Assumption columns are shown for rows with complete inputs.
WITH inputs ("row_id", "in_D", "in_C", "in_B", "in_A") AS (
-- tangibool:example-rows:begin
VALUES
(1, FALSE, FALSE, FALSE, FALSE),
(2, FALSE, FALSE, FALSE, TRUE),
(3, FALSE, FALSE, TRUE, FALSE),
(4, FALSE, FALSE, TRUE, TRUE),
(5, FALSE, TRUE, FALSE, FALSE),
(6, FALSE, TRUE, FALSE, TRUE),
(7, FALSE, TRUE, TRUE, FALSE),
(8, FALSE, TRUE, TRUE, TRUE),
(9, TRUE, FALSE, FALSE, FALSE),
(10, TRUE, FALSE, FALSE, TRUE),
(11, TRUE, FALSE, TRUE, FALSE),
(12, TRUE, FALSE, TRUE, TRUE),
(13, TRUE, TRUE, FALSE, FALSE),
(14, TRUE, TRUE, FALSE, TRUE),
(15, TRUE, TRUE, TRUE, FALSE),
(16, TRUE, TRUE, TRUE, TRUE),
(17, NULL::boolean, FALSE, FALSE, FALSE)
-- tangibool:example-rows:end
),
checked AS (
SELECT
inputs.*,
CASE
WHEN "in_D" IS NULL OR "in_C" IS NULL OR "in_B" IS NULL OR "in_A" IS NULL THEN 'invalid_input'
WHEN NOT (NOT ("in_D" AND ("in_C" OR "in_B"))) THEN 'out_of_scope'
ELSE 'ok'
END AS "status"
FROM inputs
)
SELECT
"row_id",
"in_D",
"in_C",
"in_B",
"in_A",
"status",
CASE WHEN "status" <> 'invalid_input' THEN (NOT ("in_D" AND ("in_C" OR "in_B"))) END AS "assumption_k1",
CASE WHEN "status" = 'ok' THEN (((NOT "in_D") AND (NOT "in_C") AND (NOT "in_B") AND (NOT "in_A")) OR ((NOT "in_D") AND (NOT "in_C") AND "in_B" AND (NOT "in_A")) OR ((NOT "in_D") AND (NOT "in_C") AND "in_B" AND "in_A") OR ((NOT "in_D") AND "in_C" AND (NOT "in_B") AND "in_A") OR ((NOT "in_D") AND "in_C" AND "in_B" AND (NOT "in_A")) OR ((NOT "in_D") AND "in_C" AND "in_B" AND "in_A") OR ("in_D" AND (NOT "in_C") AND (NOT "in_B") AND (NOT "in_A")) OR ("in_D" AND (NOT "in_C") AND (NOT "in_B") AND "in_A")) END AS "out_segment_a"
FROM checked
ORDER BY "row_id";
SMT-LIB
; Tangibool SMT-LIB export (tangibool.smtlib/1) ; Profile: SMT-LIB 2.6 Boolean subset (QF_UF): Bool constants, define-fun, let, push/pop, assert, check-sat, echo. ; Tested with Z3 5.1.0 (z3-solver 5.2.0, WebAssembly build). ; Model: not stated ; Source revision: reference ; Interpretation status: not stated ; Exporter: 1.0.0 (engine 1.0.0; semantics tangibool-semantics/1) ; Logic digest: fa0a837018d065810261a99bf9b01e2e337b932d2626d640db3cd91cd5f406dc ; Assumptions digest: 358b5df2f94f91c39cac1783c9c1647a33fa8d02d2026300c71af6a6606a1a92 ; Mode: decision ; ; Reading results: each query block states what sat and unsat mean for its question. A sat ; answer comes with a witness or counterexample (ask for it with (get-model) after sat only); ; unsat settles that scoped query and is solver-checked, not an independently checked proof ; certificate; unknown settles nothing. Blocks are scoped with push/pop, so assertions never ; accumulate across questions. This checks the supplied model, not whether it is a complete, ; legal, or safe statement of a real-world rule. ; ; Symbols (stable ID: name -> symbol): ; v_7da2abdb16e1: D -> in_D ; v_564a2130f32e: C -> in_C ; v_6de50780b905: B -> in_B ; v_4270e4ecab98: A -> in_A ; f_5b4b17b0dce7: segment_a -> out_segment_a ; f_265ee8e74dc1: k1 -> assumption_k1 (set-option :produce-models true) (set-info :smt-lib-version 2.6) (set-logic QF_UF) ; ---- Inputs (declared order) (declare-const in_D Bool) ; D (declare-const in_C Bool) ; C (declare-const in_B Bool) ; B (declare-const in_A Bool) ; A ; ---- Outputs (dependencies first) ; output segment_a (stable ID f_5b4b17b0dce7): \u03a3m(D, C, B, A; 0, 2, 3, 5, 6, 7, 8, 9) (define-fun out_segment_a () Bool (or (and (not in_D) (not in_C) (not in_B) (not in_A)) (and (not in_D) (not in_C) in_B (not in_A)) (and (not in_D) (not in_C) in_B in_A) (and (not in_D) in_C (not in_B) in_A) (and (not in_D) in_C in_B (not in_A)) (and (not in_D) in_C in_B in_A) (and in_D (not in_C) (not in_B) (not in_A)) (and in_D (not in_C) (not in_B) in_A))) ; ---- Assumptions (the scope K; never folded into an output) ; assumption k1 (stable ID f_265ee8e74dc1): NOT (D AND (C OR B)) ; The four bits encode a decimal digit 0 to 9 (BCD); codes 10 to 15 never occur. (define-fun assumption_k1 () Bool (not (and in_D (or in_C in_B)))) ; K: conjunction of the enabled, confirmed assumptions (true when there are none) (define-fun K () Bool assumption_k1) ; ---- Definitions only: nothing is asserted and no check is run. ; Add (assert ...) and (check-sat) inside (push 1) ... (pop 1) to ask a question.
LaTeX
segment_a = \sum m_{(D, C, B, A)}(0, 2, 3, 5, 6, 7, 8, 9)El error habitual
Leer el resultado de cuatro términos como equivalente al original en las dieciséis filas. No lo es: los grupos usan las seis celdas de indiferencia, y el motor marca el resultado como equivalente solo dentro de los supuestos. La anotación de alcance del mapa es el aviso; quita el supuesto y habrá que volver a dibujar el mapa.
Preguntas
¿De dónde salen las indiferencias?
Solo del supuesto declarado k1. El motor nunca adivina indiferencias; marca como indiferencia exactamente las celdas que los supuestos confirmados excluyen, seis aquí, e informa del recuento. Sin supuesto, el mapa trabaja sobre las dieciséis filas tal cual.
¿Por qué los recuentos de compuertas son tan grandes?
El conversor construye las compuertas a partir de la forma desarrollada de ocho términos, no del resultado de cuatro términos del mapa, y la construcción mecánica duplica inversores. 407 compuertas NAND y 719 NOR son propiedades de esa construcción; no afirman nada sobre el menor número posible de compuertas.
Relacionado
Herramientas
- Generador de tablas de verdad: cualquier expresión booleana, hasta 12 variables, con columnas intermedias
- Calculadora y simplificador de álgebra de Boole paso a paso (cada ley nombrada y verificada)
- Solucionador de mapas de Karnaugh: de 2 a 4 variables, agrupaciones, SOP y POS
Véase también
- Dígito BCD mayor que cinco: mapa de Karnaugh de cuatro variables con indiferencias
- Condición de indiferencia (don’t care): definición, ejemplo y equivalente en inglés
- Solucionador de mapas de Karnaugh: de 2 a 4 variables, agrupaciones, SOP y POS
- Supuesto (restricción del dominio): definición, ejemplo y equivalente en inglés
- Los supuestos inconsistentes hacen que todas las pruebas pasen
- Desarrollo en mintérminos: la suma canónica de productos (Σm)
Ejemplos resueltos
Generado a partir del motor de Tangibool, semántica tangibool-semantics/1, motor 1.0.0, compilación . Cada tabla, mapa, simplificación y veredicto de estas páginas lo calculó el motor de Tangibool al compilar el sitio, y cada afirmación la volvió a comprobar el mismo verificador exacto que usa la app. Los límites se indican donde aplican. © 2026 Foreranger LTD.