From: Dmitry Selyutin Date: Sat, 31 Jul 2021 18:56:16 +0000 (+0000) Subject: isa/bcd: BCD_TO_DPD helper X-Git-Tag: xlen-bcd~165 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b115b0ae7b6f5cd56527576599f66c83fecc9fa;p=openpower-isa.git isa/bcd: BCD_TO_DPD helper --- 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)