Could you help
Binary 10010111 convert to
excess128 ? my answer is 142-128= 14
8bit floating point?
Related
I am doing a CTF challenge. I open a broken BMP image file with a hex editor (HexFiend). I highlight 4 bytes in hex 8E262C00. In the bottom, HexFiend shows their value in decimal 2893454. However, I use online hex to decimal converting tool, their value is 2384866304.
Do anyone know how HexFiend comes up with 2893454?. I believe it is a correct answer, because that is the size of the file.
It's the endianness of the file.
A binary encoded file can be encoded with small or big endian. The difference is which succession the single bytes have, i.e. if you read them from left or from right. Note that the order of bits almost always is big endian. The natural way of reading is big ending; the bytes are stores as you would expect it. 8E262C00 becomes 8E 26 2C 00. This file, however, seems to be stored in small endian format. The order is flipped. In other words; 8E262C00 now becomes 00 2C 26 8E which then results in the decimal representation of 2893454
I think it's the Big Endian and Little Endian things.
You should check out this online converting tool, BMP file format is the Little Endian, but i think the tool maybe convert it by Big Endian method.
try it: https://www.scadacore.com/tools/programming-calculators/online-hex-converter/
How to convert this ,
I m not getting this?
I tried converting that into decimal 10*16^-1 and so on and got this (0.6708068848)10
Now it become really a complex task is there any short method to do so?
I think you're over-complicating it; I find it easiest to first convert it to binary (base-2) and then to octal (base-8).
Binary (bits partitioned into 3's because octal numbers have 3 bits):
0.101_010_111_011_101_000
Octal:
0.527350
I am taking an image file and converting it into binary format. Then I am converting that binary as a decimal format. But according to my algorithm I want to take 50,000 bits at a time following I am explaining my algorithm.
Read an image file from any programming language.
Convert that into binary format(pure 0's and 1's).
Take 50,000 bits at a time and convert it into decimal format(here I am taking only 1000 bits right now)
Convert that decimal again into again binary format.
Now problem is:
How can I take 50,000 bits at time to convert that into binary format
How will I convert that decimal number to binary again.
Here are 2 demos
Converting Binary to decimal https://repl.it/IHMY/1
Converting decimal to binary https://repl.it/IHMY
Thanks
Finally I have done please follow following link:
https://repl.it/IHMY/4
import math;
binary=0b11111111110110001111111111100001
decimal=int(binary)
print(decimal)
print("{0:#b}".format(decimal))
how to get binary of any decimal values...say for example 0.33, 0.6,0.5..
Can someone explain the concept..Once binary representation of decimal values are done..i need to understand the floating representation.
Here is the solution
0.33*2=0.66--------0
0.66*2=1.32--------1
0.32*2=0.64--------0
0.64*2=1.28--------1
0.28*2=0.56--------0
0.56*2=1.12--------1
0.12*2=0.24--------0
0.24*2=0.48--------0
0.48*2=0.96--------0
0.96*2=1.92--------1
0.92*2=1.84--------1
.................
this process continues until result becomes zero and write down to up after point eg:0.11000101010
Hope it may be useful to you.
I am working on a calculator that allows you to perform calculations past the decimal point in octal, hexadecimal, binary, and of course decimal. I am having trouble though finding a way to convert floating point decimal numbers to floating point hexadecimal, octal, binary and vice versa.
The plan is to do all the math in decimal and then convert the result into the appropriate number system. Any help, ideas or examples would be appreciated.
Thanks!
Hmm... this was a homework assignment in my university's CS "weed-out" course.
The operations for binary are described in Schaum's Outline Series: Essential Computer Mathematics by Seymour Lipschutz. For some reason it is still on my bookshelf 23 years later.
As a hint, convert octal and hex to binary, perform the operations, convert back to binary.
Or you can perform decimal operations and perform the conversions to octal/hex/binary afterward. The process is essentially the same for all positional number systems arithmetic.
What Programming Language are you using?
it is definatly a good idea to change everything into binary do the math on the binary then convert back. if you multiply a (unsigneD) binary number by 2, ti is the same as a Bit Shift Left ( << 1 in C), a division by 2 is the same as a Bit shit Right (>> in C).
addition and subtraction is the same as you would do in elementary school.
also, remember that if you cast a float as an int it will truncated it int(10.5) = 10;
I had this same problem a few days ago. I found http://www.binaryconvert.com, which allows you to convert between floating point decimal, binary, octal, and hexadecimal in any order you want.