Link to home
Start Free TrialLog in
Avatar of william007
william007

asked on

Definition of DWord

DWord
http://www.google.com/search?hl=en&lr=&rls=GGLD,GGLD:2005-04,GGLD:en&oi=defmore&defl=en&q=define:DWORD
Definition:
Double word. A data element that is 2 words, 4 bytes, or 32 bits in size.

Why 2 words is 4 bytes? isn't it 2 bytes?

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

1 word is 2 bytes, hence 1 dword 2x2 bytes.
dword = double word ...
Avatar of william007
william007

ASKER

Hi,
May I know for the following, they have how many bytes respectively?
1 number
1 letter(ASCII)
1 letter(UNICODE)
1 number
 => 1 digit ?
 => a number ?
actually, this depends on the data type that you will be using.

1 letter (ie character)
 -> 1 byte

1 letter (unicode)
 -> 2 bytes

1 Word (2 bytes) of computer memory (RAM) holds either 1 UNICODE character, or 2 ASCII Characters.

depending on the datatype being used, a number can be held in 1 word (INTEGER), 2 words (LONG INTEGER) or (with a 64 bit operating system) 4 words

AW
ASKER CERTIFIED SOLUTION
Avatar of SunBow
SunBow
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actual storage of characters in words can also differ. It used to be more common that the first byte would be second character, the second byte would be first character. When IBM had decided twelve bit addressing was sufficient, that lead to alternating reading in hex of the actual order of bits used to form the completed 12 bit datum, a difference between evens and odds. (see also: FAT).
                            [Extracts]

http://www.cc.gatech.edu/gvu/people/randy.carpenter/folklore/v5n1.html 

The BINAC ...  The word size was 31 bits:

The UNIVAC's word size was 72 data bits, which held eleven digits plus a sign, plus one parity bit for each six data bits, giving a total of 84

The program instructions were six decimal digits (36 bits, excluding parity bits) long, so two instructions fit in each word.

http://en.wikipedia.org/wiki/PDP-11

The PDP-11 was a 16-bit minicomputer sold by Digital Equipment Corp. in the 1970s and 1980s. The PDP-11 was a successor to DEC's PDP-8 computer in the PDP series of computers. It had several uniquely innovative features, and was easier to program than its predecessors. While well-liked by programmers, it was eventually superseded by personal computers, including the IBM PC and Apple II. The instruction set architecture of the PDP-11 influenced the design of the C programming language .
There is no "Word" but there is a "DWord".

DWord is unsigned, giving you the "Double".

I recommend creating a string and converting the Dword.ToString.  Then you can inspect it and change it to the variable that closest matches.

There is no 'unsigned variable' in VB.NET.
william007 > May I know for the following, they have how many bytes respectively?

ditto angelIII
One bit can convey a number

Ascii is more often 7 bits, but a byte is close enough because the extra bits are also useful.

It depends in part on how high you want to count, and what level of precision you want in the numbering scheme.

While the Univac, above, had eleven digits in a word,
more often these days range of counting is increased by adding bytes
with a tradeoff on memory and compute time
(smaller is faster and more compressed, takes less space, meaning, more efficient)

> You seem to be using VB6:

more probably a reference to assembly language for micro-computing
this is general programming TA, and question is very general
Thanks:-)
Thanks.
If you've still the interest, try looking up "integer overflow" (div/0) and BCD. Even EBCDIC (yuck). For example:

william007 > May I know for the following, they have how many bytes respectively?
Q> 1 number

Answer: one half byte            [BCD]

(see also: nibble)

http://en.wikipedia.org/wiki/Binary-coded_decimal

Binary-coded decimal (BCD) is, after character encodings, the most common way of encoding decimal digits in computing and in electronic systems.

In BCD, a digit is usually represented by four (binary) bits, of which the leftmost (written conventionally) has value 8, and the remaining three have values 4, 2, and 1. Many other ways of encoding ten values in four bits have been used, but in general only the combinations of bits which have values in the range 0-9 are valid. (Other combinations are sometimes used for sign or other indications.)