From 9b115b0ae7b6f5cd56527576599f66c83fecc9fa Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 31 Jul 2021 18:56:16 +0000 Subject: [PATCH] isa/bcd: BCD_TO_DPD helper --- openpower/isafunctions/bcd.mdwn | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 openpower/isafunctions/bcd.mdwn diff --git a/openpower/isafunctions/bcd.mdwn b/openpower/isafunctions/bcd.mdwn new file mode 100644 index 00000000..e37bbca1 --- /dev/null +++ b/openpower/isafunctions/bcd.mdwn @@ -0,0 +1,38 @@ +# B.1 BCD-to-DPD Translation + +The following describes conversion from 3-digit BCD to 10-bit DPD. + + + + def BCD_TO_DPD( BCD ): + a <- BCD[0] + b <- BCD[1] + c <- BCD[2] + d <- BCD[3] + e <- BCD[4] + f <- BCD[5] + g <- BCD[6] + h <- BCD[7] + i <- BCD[8] + j <- BCD[9] + k <- BCD[10] + m <- BCD[11] + + p <- ((f & a & i & ¬e) | (j & a & ¬i) | (b & ¬a)) + q <- ((g & a & i & ¬e) | (k & a & ¬i) | (c & ¬a)) + r <- d + + s <- ((j & ¬a & e & ¬i) | (f & ¬i & ¬e) | + (f & ¬a & ¬e) | (e & i)) + t <- ((k & ¬a & e & ¬i) | (g & ¬i & ¬e) | + (g & ¬a & ¬e) | (a & i)) + + u <- h + + v <- (a | e | i) + + w <- ((¬e & j & ¬i) | (e & i) | a) + x <- ((¬a & k & ¬i) | (a & i) | e) + y <- m + + return (p || q || r || s || t || u || v || w || x || y) -- 2.30.2