Download presentation
Presentation is loading. Please wait.
Published byLily Stevenson Modified over 9 years ago
1
Introduction to CAFE Yu Hen Hu & C. R. Kime Revised October 9, 2001
2
Introduction CAFE (Connection Arrays From Equations) is a Boolean function simplification program that can simultaneously simplify a set of Boolean functions sharing the same set of Boolean variables. To use CAFE, you create an input file which consists of –Function specifications: A list of functions to be minimized. Can be Boolean equations, a truth table, minterms, maxterms, or a tabular form –Process specification: specifies what kind of output you want
3
CAFE Syntax A sample CAFE program: Full Adder p=a@b, g=a*b, s=p@cin, cout=g+p*cin. c s cout. Variables: case sensitive, but commands are case in- sensitive. Boolean operators: -, ~, / not *, & AND $, ~& NAND @ XOR # A*~B !, ~| NOR +, | OR () punctuation, end of equation. end of last equation or other specification
4
Function Specifications : var_out = Boolean_expr = Boolean_expr. –If multiple outputs separated by, –Optional: dummy = all input variables ANDed together - used to order variables. : –Input var list. E.g. 3 a b cin. –var_out = minterm #s. : –Same as minterm : 3 a b c. x = 1x1 x10 = x00. Everywhere else, x = 0 : 4 a b c d. Inputs 3 w x y. Outputs 0 0 x 0 1 1 – 0 x 1 x - 1 1 Note: x or X or - in inputs, means variable missing; in outputs, means don’t care. Terms for x = 1 Terms for x = don’t care Expr for var_out = 1 Expr for var_out = don’t care
5
Process Specifications and Commands Process specifications tells what format of the output should be. C: connection array E: equations T: truth table Advanced specifications: – K, L, R: not covered or used here. Terminal command for running CAFE: cafe [option] infile outfile Options: -e Suppress echo of input equations with results -f Fast connection arrays (the cheap solution of questionable quality) -r Repeat reduction -x Extraction algorithm (the systematic procedure we studied; may run long time!)
6
Example 1: Truth Table to Equations Input file: optran as at left 5 op2 op1 op0 sign corr.Command: cafe –x optran optran.out 2 sub comp_a. 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 0 X 0 0 0 0 1 0 X 0 0 0 X X X X 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 X X 1 X 0 X X X 1 X X 0 X X 1 X X X 0 X X. e sub comp_a. q
7
Example 1: Truth Table to Equations CONTINUED: Connection Arrays from Equations Feb 18 2001 21:00:09 Page 1 File: op_tran Run Options: x 1: 2: 5 op2 op1 op0 sign corr. 3: 2 sub comp_a. 4: 0 0 0 1 0 1 0 5: 0 0 1 0 0 1 0 6: 1 0 0 X 0 0 0 7: 0 1 0 X 0 0 0 8: X X X X 1 0 1 9: 0 0 0 0 0 0 0 10: 0 0 1 1 0 0 0 11: X X 1 X 0 X X 12: X 1 X X 0 X X 13: 1 X X X 0 X X 14: 0 0 0 X 0 X 1. 15. 16: e sub comp_a. sub = -sign*-corr + -op0*-corr comp_a = corr + -op0*-corr 0.010 seconds
8
Example 2: Minterms to Equations Connection Arrays from Equations Sep 25 2000 11:08:59 Page 1 File: adder1 Run Options: 1: adder1 2: 3 a b cin. 3: s = 1 2 4 7, 4: co = 3 5 6 7. 5: 6: e s co. s = -a*-b*cin + -a*b*-cin + a*-b*-cin + a*b*cin co = b*cin + a*cin + a*b
9
Example 3: Minterms to Truth Table 1: adder1 2: 3 a b cin. 3: s = 1 2 4 7, 4: co = 3 5 6 7. 5: 6: t s co. 3 Input Variables 2 Output Variables 8 Cube Truth Table ------ abc sc i o n ------ 000 00 001 10 010 10 011 01 100 10 101 01 110 01 111 11 Connection Arrays from Equations Sep 25 2000 11:39:37 Page 1 File: adder1 Run Options:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.