Rank: 2449 based on 19 downloads (last 30 days) and 2 files submitted
photo

Moatasem Chehaiber

E-mail

Personal Profile:

Specialised in Logic design and its implementations in Programmable Logic Devices (PLDs) and ASICs.

Professional Interests:
Signal Processing

 

Watch this Author's files

 

Files Posted by Moatasem View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
23 Jan 2007 Binary to Decimal Converts binary data of any format in a string to floating point Author: Moatasem Chehaiber floating point decima..., binary, fixed point, wireless 2 2
  • 1.0
1.0 | 1 rating
18 Dec 2006 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber wireless, twos complement, decimal, convert, wireless communicatio... 17 3
  • 3.2
3.2 | 5 ratings
Comments and Ratings on Moatasem's Files View all
Updated File Comment by Comments Rating
29 Jun 2011 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber Gorka
13 Nov 2010 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber Naseri, Hassan

I wrote two simple functions, to convert between decimal and two's complement integers:

function value = dec2tc(dec, N)
value = dec2bin(mod((dec),2^N),N);
end

function value = tc2dec(bin,N)
val = bin2dec(bin);
y = sign(2^(N-1)-val)*(2^(N-1)-abs(2^(N-1)-val));
if ((y == 0) && (val ~= 0))
  value = -val;
else
    value = y;
end
end

18 Jun 2007 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber CrapPrograms, DontSubmit

this is a very bad program,
Flaw 1) It doesnt work, e.g. heres what i get
dec2bit(0.3,5) = 00100, ok, then
dec2bit(-0.3,5) gives me just the 1's complement = 11011, but it should be 11100.

18 Jun 2007 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber 44, 47

so who loves hockey around here? eh?

22 Mar 2007 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber abd, fatima
Top Tags Applied by Moatasem
wireless, binary, convert, decimal, fixed point
Files Tagged by Moatasem View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
23 Jan 2007 Binary to Decimal Converts binary data of any format in a string to floating point Author: Moatasem Chehaiber floating point decima..., binary, fixed point, wireless 2 2
  • 1.0
1.0 | 1 rating
18 Dec 2006 from decimal to two's complement a function to convert a decimal number into 2's complement number of defined size Author: Moatasem Chehaiber wireless, twos complement, decimal, convert, wireless communicatio... 17 3
  • 3.2
3.2 | 5 ratings

Contact us at files@mathworks.com