Commit 744fa133 authored by apaj's avatar apaj
Browse files

Adapting HiLoMultiplier

parent 71c86679
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
// See LICENSE.txt for license details.
// January 22nd, 2018	- adapted to Learning Journey

package examples

import chisel3._
import Chisel._

//A 4-bit adder with carry in and carry out
class HiLoMultiplier() extends Module { 
  val io = IO(new Bundle {
    val A  = Input(UInt(16.W))
    val B  = Input(UInt(16.W))
    val Hi = Output(UInt(16.W))
    val Lo = Output(UInt(16.W))
  })
  val io = new Bundle { 
    val A  = UInt(INPUT, 16) 
    val B  = UInt(INPUT, 16) 
    val Hi = UInt(OUTPUT, 16) 
    val Lo = UInt(OUTPUT, 16) 
  } 
  val mult = io.A * io.B 
  io.Lo := mult(15, 0) 
  io.Hi := mult(31, 16)