#1   Report Post  
MadManInABox
 
Posts: n/a
Default Binary bit analysis

Here's my situation, I need to be able to get this sort of response:

I have a 32 bit binary word, each bit corresponds to a certain alarm. So if
a certain bit in the word is 1 then that alarm is flagged, however if several
bits are 1 then all the corresponding alarms are flagged.

Is there some way to use some sort of lookup table which will show which
alarms have been triggered?
  #2   Report Post  
Ian
 
Posts: n/a
Default

I don't know how you want to display the results, but using =MID(A1,x,1)
where x is 1 to 32 will return the value of that bit. You can ite this in
with an IF statement to give something like
=IF(MID(A1,x,1)=1,"Alarm","Noalarm"). Note that this counts from the left,
so changing x to 1 will return the MSB.

--
Ian
--
"MadManInABox" wrote in message
...
Here's my situation, I need to be able to get this sort of response:

I have a 32 bit binary word, each bit corresponds to a certain alarm. So
if
a certain bit in the word is 1 then that alarm is flagged, however if
several
bits are 1 then all the corresponding alarms are flagged.

Is there some way to use some sort of lookup table which will show which
alarms have been triggered?



  #3   Report Post  
Stefi
 
Posts: n/a
Default

I'm afraid you didn't notice that Madman wrote 32 bits and not bytes!
Stefi


€˛Ian€¯ ezt Ć*rta:

I don't know how you want to display the results, but using =MID(A1,x,1)
where x is 1 to 32 will return the value of that bit. You can ite this in
with an IF statement to give something like
=IF(MID(A1,x,1)=1,"Alarm","Noalarm"). Note that this counts from the left,
so changing x to 1 will return the MSB.

--
Ian
--
"MadManInABox" wrote in message
...
Here's my situation, I need to be able to get this sort of response:

I have a 32 bit binary word, each bit corresponds to a certain alarm. So
if
a certain bit in the word is 1 then that alarm is flagged, however if
several
bits are 1 then all the corresponding alarms are flagged.

Is there some way to use some sort of lookup table which will show which
alarms have been triggered?




  #4   Report Post  
Bernd Plumhoff
 
Posts: n/a
Default

Put your word (integer) into cell A1, select cells B1:B28 and enter
=MOD(INT($A$1/(2^(ROW()-1))),2)
with CTRL+SHIFT+ENTER (as array formula).

This will work for 28 bits (highest possible number: 268,435,455).

HTH,
Bernd
  #5   Report Post  
Stefi
 
Posts: n/a
Default

I tried it, but it gave zero in all cells B1:B28 for any value in A1!
What's wrong?
Stefi


€˛Bernd Plumhoff€¯ ezt Ć*rta:

Put your word (integer) into cell A1, select cells B1:B28 and enter
=MOD(INT($A$1/(2^(ROW()-1))),2)
with CTRL+SHIFT+ENTER (as array formula).

This will work for 28 bits (highest possible number: 268,435,455).

HTH,
Bernd



  #6   Report Post  
Ian
 
Posts: n/a
Default

"Stefi" wrote in message
...
I'm afraid you didn't notice that Madman wrote 32 bits and not bytes!
Stefi

Yes, I did. I am assuming this 32bit binary word is a string of 32 zeros &
ones, each character representing 1 bit. If this is not the case, then
perhaps MadManInABox could enlighten me.

--
Ian
--


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recalculating a Regression Output in Data Analysis karin Excel Worksheet Functions 1 August 23rd 05 03:40 AM
Binary Numbers longer than 10 characters Andibevan Excel Worksheet Functions 2 April 6th 05 10:08 PM
Why " data analysis plus " override " data analysis " once instal. Alfred H K Yip Excel Worksheet Functions 1 March 20th 05 08:10 AM
Analysis ToolPak installed but no Data Analysis option Eric Stephens Excel Discussion (Misc queries) 3 February 2nd 05 09:17 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"