Questions tagged [number-formats]

For questions about method for storing and manipulating numbers on computer systems, such as floating point or binary representations.

Filter by
Sorted by
Tagged with
1
vote
1answer
51 views

What is the 2's complement answer of 16.5?

According to this post it is saying Two's complement is only for integers, but in Wolframalpha is is saying the Two's complement of 16.5 is 0010000.1, how?
0
votes
1answer
37 views

How to Convert from Decimal to Qm.n format

How would you convert decimal 0.0650 to 1.15 Q format 16-bit of course? I'm kinda stuck in this for 3 days, can someone kindly help me out in this
39
votes
6answers
58k views

The math behind converting from any base to any base without going through base 10?

I've been looking into the math behind converting from any base to any base. This is more about confirming my results than anything. I found what seems to be my answer on mathforum.org but I'm still ...
3
votes
2answers
2k views

Smallest number close to 0 in IEEE754 (64bits)?

I thought the smallest number close to 0 would be : 0 00000000001 (exponent) 0000000000000000000000000000000000000000000000000000 (significand) But this site (http://binaryconvert.com/result_double....
-2
votes
1answer
55 views

facts about ieee 754

Someone told me this and I would be interested to know if it is true: In the ieee 754 format approximately half of the positive numbers are in the interval [0, 1]
0
votes
2answers
54 views

What needs led to the implementation of ASCII codes?

Prior to ASCII existing, we already had at least four number systems, namely Binary Decimal Octal Hexadecimal So what were the needs that lead to the ...
0
votes
4answers
136 views

Is decimal number 8 represented as 3 bits or 4 bits in computer?

I was told by my professor that "It takes c * ln(n) bits to store a number n, where ln() is base 2 and c is a constant." Thus, to store a number 8, we need ln(8) = 3 bits(I think const c can be ...
2
votes
1answer
78 views

Repeated addition and comparisons of floating point numbers

In the following program where I repeatedly half an integer, it takes until i = 1074 for my integer to be equal to zero (I know that ideally the while loop shouldn'...
1
vote
2answers
68 views

Why can we write almost any nonzero 2-adic integer in the same form?

The title was difficult to formulate (I am open to suggestions). Two things bug me about this: "is almost any" is imprecise, which goes against Volume 1's statement on definiteness. When he writes, "...
4
votes
3answers
5k views

What does normalizing with hidden bit really mean?

I have a question related to representing numbers in base 2 with floating point. For example, if I have such a number $$0.000011 \cdot 2^3$$ then is its normalized form this? $$1.1\cdot 2^{-2}$$ ...
0
votes
0answers
29 views

Little Endian and Decimal numbers

I understand that, for some hex string like 0xF0B0D0, the reverse byte order is 0xD0B0F0 since two hexademical digits represent ...
0
votes
0answers
42 views

calculating the index in a FOR loop

I am coding in Matlab: ...
1
vote
4answers
74 views

How does a computer compute negative(-) and positive(+) Infinity?

If we divide (1.0/0.0) we will get +Infinity and if we divide (-1.0/0.0) we will get -Infinity. How does a computer calculate this value internally?
3
votes
2answers
108 views

How much can we trust mathematical software when working with large numbers, and how much memory it needs to work with these numbers?

For example, I want to evaluate the expression: $3^{3^{{3}^{3}}}$ so I used wolframalpha.com (it's free, and I don't own any software), which returned the scientific notation of the number above, ...
2
votes
3answers
1k views

Is there any practical trick to mentally count in Gray code?

When I was fairly young, I taught myself to count in binary. I thought it would be a fun party trick to impress people. I soon found out that it was not. Over the years I've come to appreciate Gray ...
1
vote
2answers
50 views

Space-efficient representation of potentially very large arbitrary-precision rationals?

I'd like to know if there are good techniques for faithfully and (reasonably) representing rational numbers with forms similar to: 2/3 1/10 4 * 10 ^ 1,000,000,000,000 I know arbitrary precision ...
0
votes
3answers
2k views

What is the 1's and 2's complement of 0.01101?

What is the 1's and 2's complement of 0.01101? I'm unable to find any details on this from google. Basically how do we represent the floating points in 1's and 2's complement forms? Even wikipedia ...
1
vote
1answer
29 views

What is the equivalent of the integers symbol Z for n bit only integers?

We refer to the set of all integers as $\mathbb{Z}$. Now suppose we have a set of integers that can be held within a computer variable of $n$ bits width. Clearly they can only be of $2^{n}$ range, ...
0
votes
1answer
101 views

Why isn't it necessary to store an integer part of significant in IEEE754 floating point notation?

We see that there is a sign, exponent, and mantissa part for the notation. But, there is no location for the significant bit. Why isn't it necessary to store an integer part of significant in IEEE754 ...
0
votes
0answers
33 views

Converting a decimal to IEEE754 32-bit binary number

Convert 0.625 to IEEE754 32-bit binary number. 0.625 x 2 = 1.250 0.250 x 2 = 0.500 0.500 x 2 = 1.000 So, ...
0
votes
3answers
475 views

IEEE754 representation in hexadecimal?

In class, I've heard hexadecimal representation for IEEE754 mentioned and described in 32bit length as a format that consists of one bit for sign, normalized 6-digit fraction (with an implied leading ...
3
votes
2answers
762 views

Why does little endian apply to numbers and not to text strings?

The Portable Executable file format is the format that Windows EXE files use. It is a binary format. Numbers are in little endian form. Thus, the following hex represents the decimal number 256, not ...
1
vote
1answer
225 views

n-bit 2's Complement Conversion

I'm learning 2's complement conversion for positional number systems. For the most part I have only seen 2's complement for represented in 8-bits. I had a discussion with a friend who explained that ...
3
votes
1answer
3k views

Overflow rule in two's complement arithmetic

In the book by William Stallings the overflow rule overflow rule for 2's complement addition is stated as follows: Overflow rule: If two numbers are added, and they are both positive or both ...
1
vote
1answer
48 views

Two's complement max with a different base

Working with fixed size integer representations, use a number system with b-complement notation, base b = 9 and n = 4 digits. What is the smallest number that can be represented in this number system?...
0
votes
1answer
57 views

Why are floats converted from different integers sometimes equal?

I'm trying to understand the following algorithm: ...
3
votes
2answers
41 views

How many unique counting functions there are for strings of N bits?

Let a counting function inc for inputs of N bits be defined as: ...
1
vote
1answer
38 views

What is the range of possible IP addresses when expressed as decimal and hexadecimal?

I know that there are $2^{32}$ different combinations of IPv4 addresses possible , if expressed in binary. In decimal notation, they range from $0.0.0.0$ to $255.255.255.255$. So are there $256^{4}$ ...
2
votes
1answer
3k views

Confusion in 2's complement of 00000000

I'm solving the end of the chapter problems of Morris Mano's Digital Design (4th Edition, if that's relevant). In one of the problems, it is asked to simply find the 1's and 2's complement of 00000000....
1
vote
4answers
636 views

Float multiplication

While doing the multiplication 1.4*0.8 in a python program, I got the result as 1.1199999999999999. Why didn't I get ...
5
votes
1answer
109 views

Imaginary numbers and negative zero

I've been studying the low-level hardware implementations of floating point numbers and doing an exercise to design a custom floating point implementation. I know that being able to represent ...
1
vote
3answers
3k views

Why do we need to convert binary numbers into hexadecimal, octal and decimal?

Computer reads binary. Now my question is, what is the use of hexadecimal, octal and decimal? Do Computers understand or can read hexadecimal, octal and decimal? This question remains a mystery for me....
0
votes
0answers
48 views

IEEE largest number for any machine representation

If we consider a machine that uses 64 bits to represent a number. If 1 bit is used for sign, "x" bits to represent mantissa and (63-x) to store the (biased) exponent in a manner similar to the IEEE ...
1
vote
1answer
231 views

$2^1 + 2^2 + \cdots + 2^8$ in binary

Maybe these are silly question. I know almost nothing about computer science, so please let me know in the comment section if I should edit anything or delete it. Let's say I have a function that ...
0
votes
1answer
156 views

-4 as floating point

How would one represent the number -4 as an 8-bit normalised, 2's complement, floating point, with 4 bits dedicated to the exponent? As a normal 4-bit 2's complement number, it would be represented ...
2
votes
3answers
4k views

Floating point normalised numbers in binary

Many text books state that for a binary floating point representation in a computer byte, that if the mantissa is normalised, then a positive number must start with 01 from the left or a negative ...
23
votes
7answers
9k views

Why floating point representation uses a sign bit instead of 2's complement to indicate negative numbers

Consider a fixed point representation which can be regarded as a degenerate case of a floating number. It is entirely possible to use 2's complement for negative numbers. But why is a sign bit ...
2
votes
2answers
1k views

Implicit Leading 1 in Binary Floating Point

Is the convention of dropping the leading 1 when storing the significand a given in all binary floating point representations or not necessarily?
2
votes
3answers
653 views

Can a unnormalized floating point number be recognized also when exponent is not zero?

From Tanebaum's Structed Computer Organization. Exercise 4 of Appendix B The following binary floating-point number consist of a sign bit, an excess $64$, radix $2$ exponent, and a $16$-bit ...
1
vote
1answer
66 views

Smallest number with in a larger number with a certain length

I have a number with $n$ digits. I want to keep only $m$ digits out of it. What is the smallest possible $m$ digit number which can be generated from the larger number so that order of digits is ...
1
vote
1answer
1k views

How to convert a decimal number to ASCII representation [closed]

The question that was in my lecture notes said "Encode the decimal number 2370 in ASCII. " and the answer given there is ...
7
votes
1answer
159 views

Difference between ways to compare floating-point numbers

There seems to be many approaches to judge whether two floating-point numbers are identical. Here are some examples I've found: ...
0
votes
0answers
92 views

How to determine the range of a number represented in IEEE-754 format?

Given a format: say 12-bit floating point with sign bit, 5 - bit biased exponent and 6- bit significant with implied bit, how do i go about determining the range of ...
-1
votes
2answers
250 views

How does the CPU form the binary representation for a number?

More generally, how those translating softwares, for example, an assembler, like nasm, know how to transform in machine code the number "10", from this command: ...
1
vote
2answers
155 views

Why complement of most negative number in octal does not turn out to be itself

I know the range of the $n$ digit numbers in $r$'s complement system is given as $r^{n-1}-1$ to 0 to $-r^{n-1}$. So for 3 bit 2's complement, its: $(2^2-1)$ to $0$ to $-(2^2)$ that is $3$ ...
0
votes
0answers
2k views

Subtraction using 15s complement

I know 15s complement subtraction may not be much taught/popular one, but I just want to give it a try. Just trying to clear my basic digital logic/number systems concepts. Here is what I am doing: ...
4
votes
2answers
113 views

Why aren't numbers stored this way?

I read that the further you get from 0, the less precision, due the way they are stored. So why aren't numbers stored like this: $32$ bits for representing a value between $-2^{31}$ and $2^{31}-1$ ...
-1
votes
1answer
579 views

Convert between IEEE 754-2008 decimal64 and IEEE double precision floating point number

I need to know the algorithm for converting between IEEE 754-2008 decimal64 and IEEE 754-1985 double precision floating point number. I have been working on this for the past 2 days and I match the ...
1
vote
1answer
817 views

Convert integer of mixed radix to standard positional numeral system and vice versa

I have multiple numbers (e.g. [1, 4, 2]) where each number can be one of a specified range of numbers (e.g. [0-1, 0-5, 0-3]). I ...
1
vote
1answer
432 views

Convert 24(decimal) to modified IEEE 754 floating point format?

Here's what I have as the tweaked format I'm to use: S EEE MMMM (excess 8 format) s = sign bit, E = exponent bits, M = mantissa/fraction bits Otherwise, it follows the IEEE 754 in principle. The ...