Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Twos complement, Ones Complement (was: question about dcl...)
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 23rd January 12:43
robin
External User
 
Posts: 1
Default Twos complement, Ones Complement (was: question about dcl...)


"Shmuel (Seymour J.) Metz" <spamtrap@library.lspace.org.invalid> writes: > In <bfqkq3$3k3$1@morgoth.sfu.ca>, on 07/25/2003


Such as?
  Reply With Quote


  sponsored links


2 23rd January 12:43
shmuel (seymour j.) metz
External User
 
Posts: 1
Default Twos complement, Ones Complement (was: question about dcl...)


In <RmIUa.17559$OM3.412@news-server.bigpond.net.au>, on 07/27/2003
at 04:16 AM, robin <robin_v@bigpond.mapson.com> said:

Negating a number on a 2a complement machine. In practice that's not
an issue for the same reason that the end-around carry isn't an issue
on a 1s complement machine; you don't use a serial-by-bit adder on a
real computer.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT

Any unsolicited bulk E-mail will be subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail.

Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply
to spamtrap@library.lspace.org
  Reply With Quote


  sponsored links


3 23rd January 12:44
glen herrmannsfeldt
External User
 
Posts: 1
Default Twos complement, Ones Complement (was: question about dcl...)


This came up in the Fortran newsgroup not so long ago. There are some
places in the language where a non-negative constant is needed, so a unary -
operator would be applied. Though others where signed constants are
allowed.

In C, all constants are non-negative, with an optional unary - operator.
The most negative integer is not a legal constant in C, though a constant
expression having that value is allowed.

-- glen
  Reply With Quote
4 23rd January 12:44
glen herrmannsfeldt
External User
 
Posts: 1
Default Twos complement, Ones Complement (was: question about dcl...)


A processor that generates exceptions for fixed point overflow, and has
precise interrupts, must be careful about executing such instructions. If
it can't generate an exception it is much easier for pipelined, or
out-of-order processors. Note that some of the earlier pipelined processors
were CDC machines. It may, or may not, be related.

-- glen
  Reply With Quote
5 23rd January 12:44
mark yudkin
External User
 
Posts: 1
Default Twos complement, Ones Complement (was: question about dcl...)


writes: >

YOU BET IT IS! Never heard of imprecise interrupts on Intel? Never had a
PL/I program randomly fail on Intel because of an imprecise interrupt? If
not, it's about time you searched the IBM PL/I APAR database. In fact, I
currently have a PMR for ERFC's causing UNDERFLOW that is leading to a
random 8094 on PL/I (due to an imprecise interrupt in the library routine) open.

There are cases for both. In general most compilers will issue instructions
to normalize zeros where the machine doesn't guarantee a specific zero
result. What's important is that the user never sees 0 <> 0.

No they don't. C doesn't (by definition - it's defined not to work!), I've
had Fortrans fail, and I opened a PMR against VA PL/I way back that also got
it wrong (since fixed).
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666