Another total newbie qusetion - what is two's complement? I understand binary and significant bits having been a COBOL programmer in the 70's but seem to have missed this bit - please explain. Also what does UML stand for in class diagrams?

UML stands for Universal Modeling Language. It is a way to diagram relations between classes and objects. Two's compliment is the most common way to represent signed numbers in binary. To find the two's compliment representation of a negative number, first write the binary value of the positive number. Add enough leading zeros to fill all the bits used to store the number. Then flip each bit. In other words, change all 0's to 1's and vice versa. Then add 1 to the number. For example, if we want to represent -4 in four-bit two's compliment. We first write 4 is binary: 0100 Then flip the bits: 1011 Then add 1: 1100 The most significant bit is always 1 for negative numbers and 0 for positive numbers. Two's compliment also has several benefits for doing math in hardware. I won't get into that here. For a more detailed discussion, check out this page. HTH Layne

I've only taken a few math classes in my life, so I am pretty weak in this area, so I worked on this for a while. I found this is true: 1. divide input by radix, 2, and save the remainder as a string and save the number of times that 2 went into input as input, so input is now the result of input / radix. 2. repeat step 2 until the number is <= the radix. 3. save the last number of successful divisions 4. read the numbers in order of last calculated division to first remainder. Here is an example to convert inp to binary: inp = 19 19 / 2 = 9 r 1 9 / 2 = 4 r 1 4 / 2 = 2 r 0 2 / 2 = 1 r 0 1 --------- 1 10011 should be 19 in binary. Let's see: (1*(2 pow 0)) + (1 * (2 pow 1)) + (1 * (2 pow 4)) (1) + (3) + (16) = 19 I wrote a program and it seems to work. I didn't have any help from anyone. Please check and comment:

Would like any comments regarding this. I'd like to continue working on this so I can improve my skill in this area. Thanks,

Garrett [ December 28, 2002: Message edited by: Garrett Smith ] [ December 28, 2002: Message edited by: Garrett Smith ]

Actually UML stands for Unified Modeling Language. In addition to class diagrams, there are about eleven or so other UML diagram types. For more information, go to the website of the people who write the UML specs, OMG.