Commit 744fa133 authored by apaj's avatar apaj

Adapting HiLoMultiplier

parent 71c86679
// See LICENSE.txt for license details. // See LICENSE.txt for license details.
// January 22nd, 2018 - adapted to Learning Journey
package examples package examples
import chisel3._ import Chisel._
//A 4-bit adder with carry in and carry out //A 4-bit adder with carry in and carry out
class HiLoMultiplier() extends Module { class HiLoMultiplier() extends Module {
val io = IO(new Bundle { val io = new Bundle {
val A = Input(UInt(16.W)) val A = UInt(INPUT, 16)
val B = Input(UInt(16.W)) val B = UInt(INPUT, 16)
val Hi = Output(UInt(16.W)) val Hi = UInt(OUTPUT, 16)
val Lo = Output(UInt(16.W)) val Lo = UInt(OUTPUT, 16)
}) }
val mult = io.A * io.B val mult = io.A * io.B
io.Lo := mult(15, 0) io.Lo := mult(15, 0)
io.Hi := mult(31, 16) io.Hi := mult(31, 16)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment