ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   BIN2DEC bits 0-5 then 6-15 (https://www.excelbanter.com/excel-worksheet-functions/90896-bin2dec-bits-0-5-then-6-15-a.html)

Jim

BIN2DEC bits 0-5 then 6-15
 
Anybody able to help ?

protonLeah

BIN2DEC bits 0-5 then 6-15
 

What are you trying to do? An example with data would help.:confused:


--
protonLeah


------------------------------------------------------------------------
protonLeah's Profile: http://www.excelforum.com/member.php...o&userid=32097
View this thread: http://www.excelforum.com/showthread...hreadid=546099


Jim

BIN2DEC bits 0-5 then 6-15
 
THX for the interest
Equipment I work on outputs error messages in HEX which I then convert to
Binary to obtain a Bit map which is then broken down into groups of Bits each
group having a meaning for example:-
Bits 0-5 = Resource number
Bits 6-7 = Resource type

I am trying to write a formula that will take the Hex value I enter convert
it to a bit map and output the data in Dec with the value of Bit groups in
different cells.

"protonLeah" wrote:


What are you trying to do? An example with data would help.:confused:


--
protonLeah


------------------------------------------------------------------------
protonLeah's Profile: http://www.excelforum.com/member.php...o&userid=32097
View this thread: http://www.excelforum.com/showthread...hreadid=546099



Gary''s Student

BIN2DEC bits 0-5 then 6-15
 
An interesting problem.


In B1 enter a valid 4-character hex value:

0000
thru
FFFF

In C1 enter:
=HEX2BIN(LEFT(B1,1),4) & HEX2BIN(MID(B1,2,1),4) & HEX2BIN(MID(B1,3,1),4) &
HEX2BIN(MID(B1,4,1),4)

In D1 enter:
=BIN2DEC(LEFT(C1,6))

In E1 enter:
=BIN2DEC(RIGHT(C1,9))+512*MID(C1,7,1)


I have assumed that bit #0 is the MSB. E & D are your decimal parts. Some
typical values in B thru E a

0008 0000000000001000 0 8
0E46 0000111001000110 3 582
DEAD 1101111010101101 55 685



--
Gary's Student


"Jim" wrote:

THX for the interest
Equipment I work on outputs error messages in HEX which I then convert to
Binary to obtain a Bit map which is then broken down into groups of Bits each
group having a meaning for example:-
Bits 0-5 = Resource number
Bits 6-7 = Resource type

I am trying to write a formula that will take the Hex value I enter convert
it to a bit map and output the data in Dec with the value of Bit groups in
different cells.

"protonLeah" wrote:


What are you trying to do? An example with data would help.:confused:


--
protonLeah


------------------------------------------------------------------------
protonLeah's Profile: http://www.excelforum.com/member.php...o&userid=32097
View this thread: http://www.excelforum.com/showthread...hreadid=546099



Jim

BIN2DEC bits 0-5 then 6-15
 
Intersting solution But too complex for me I tried to get it to work let me
try and clarify the problem.

Fault Additional Info Given in Hex
Example H'ABCD AB CD
Binary Value to obtain Bit Map 10101011 11001101

Bit 15 Bit 14 Bits 8-13 Bits 5-7 Bits 0-4
Which would decode Thus 1 0 101011 110 01101
43 6 13
Reverse Dir Busy Bit LCN DLT Time Slot

Bits 14 and 15 if 1 Then True else False

Regards



"Gary''s Student" wrote:

An interesting problem.


In B1 enter a valid 4-character hex value:

0000
thru
FFFF

In C1 enter:
=HEX2BIN(LEFT(B1,1),4) & HEX2BIN(MID(B1,2,1),4) & HEX2BIN(MID(B1,3,1),4) &
HEX2BIN(MID(B1,4,1),4)

In D1 enter:
=BIN2DEC(LEFT(C1,6))

In E1 enter:
=BIN2DEC(RIGHT(C1,9))+512*MID(C1,7,1)


I have assumed that bit #0 is the MSB. E & D are your decimal parts. Some
typical values in B thru E a

0008 0000000000001000 0 8
0E46 0000111001000110 3 582
DEAD 1101111010101101 55 685



--
Gary's Student


"Jim" wrote:

THX for the interest
Equipment I work on outputs error messages in HEX which I then convert to
Binary to obtain a Bit map which is then broken down into groups of Bits each
group having a meaning for example:-
Bits 0-5 = Resource number
Bits 6-7 = Resource type

I am trying to write a formula that will take the Hex value I enter convert
it to a bit map and output the data in Dec with the value of Bit groups in
different cells.

"protonLeah" wrote:


What are you trying to do? An example with data would help.:confused:


--
protonLeah


------------------------------------------------------------------------
protonLeah's Profile: http://www.excelforum.com/member.php...o&userid=32097
View this thread: http://www.excelforum.com/showthread...hreadid=546099



Gary''s Student

BIN2DEC bits 0-5 then 6-15
 
Hi Jim:

Thanks for the clarification. I'll update tomorrow, splitting the 16 bits
into 5 groups:

bit 15
bit 14
bits 13-8
bits 7-5
bits 4-0
--
Gary''s Student


"Jim" wrote:

Intersting solution But too complex for me I tried to get it to work let me
try and clarify the problem.

Fault Additional Info Given in Hex
Example H'ABCD AB CD
Binary Value to obtain Bit Map 10101011 11001101

Bit 15 Bit 14 Bits 8-13 Bits 5-7 Bits 0-4
Which would decode Thus 1 0 101011 110 01101
43 6 13
Reverse Dir Busy Bit LCN DLT Time Slot

Bits 14 and 15 if 1 Then True else False

Regards



"Gary''s Student" wrote:

An interesting problem.


In B1 enter a valid 4-character hex value:

0000
thru
FFFF

In C1 enter:
=HEX2BIN(LEFT(B1,1),4) & HEX2BIN(MID(B1,2,1),4) & HEX2BIN(MID(B1,3,1),4) &
HEX2BIN(MID(B1,4,1),4)

In D1 enter:
=BIN2DEC(LEFT(C1,6))

In E1 enter:
=BIN2DEC(RIGHT(C1,9))+512*MID(C1,7,1)


I have assumed that bit #0 is the MSB. E & D are your decimal parts. Some
typical values in B thru E a

0008 0000000000001000 0 8
0E46 0000111001000110 3 582
DEAD 1101111010101101 55 685



--
Gary's Student


"Jim" wrote:

THX for the interest
Equipment I work on outputs error messages in HEX which I then convert to
Binary to obtain a Bit map which is then broken down into groups of Bits each
group having a meaning for example:-
Bits 0-5 = Resource number
Bits 6-7 = Resource type

I am trying to write a formula that will take the Hex value I enter convert
it to a bit map and output the data in Dec with the value of Bit groups in
different cells.

"protonLeah" wrote:


What are you trying to do? An example with data would help.:confused:


--
protonLeah


------------------------------------------------------------------------
protonLeah's Profile: http://www.excelforum.com/member.php...o&userid=32097
View this thread: http://www.excelforum.com/showthread...hreadid=546099




All times are GMT +1. The time now is 03:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com