Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how implement sign-extention block

Status
Not open for further replies.

mostafa272

Junior Member level 3
Joined
Dec 16, 2010
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,493
I want to impement the datapath and controller for I-type and R-type single cycle MIPS instructions with verilog,but I don't know for implementing sign-extention block and shift left block use which gates or functions,please guide me.
 

Sign extension is just repeating the highest order bit of the original value to all the 'to extend' bits on the left side of the new value.
 

sign extension is simply the repetition of sign bits for e.g...
a for bit number can be converted to 8-bits like this
1|111 ==> 1|1111111
0|111 ==> 0|0000111
 

thanks,but I want a function to do it.please write a function!
 

let you are converting a data bus 10bits wide to a data bus 15bits wide.
reg [9:0] bus_a; //bit10 is sign bit
reg [14:0] bus_b;

always @(*)
bus_b = {bus_a[9],bus_a[9],bus_a[9],bus_a[9],bus_a[9],bus_a[9], bus_a[8:0]};
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top