<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Diky.</FONT></DIV>
<DIV><FONT face=Arial size=2>Michal</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=wek@evona.sk href="mailto:wek@evona.sk">Jan Waclawek</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=hw-list@list.hw.cz
href="mailto:hw-list@list.hw.cz">HW-news</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, September 10, 2007 2:47
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: Vypocet parita</DIV>
<DIV><FONT face=Arial size=2></FONT><BR></DIV>TOTO v C?<BR>To je pre to
nepodarene PICko?<BR><BR>Taketo nieco by sa nedalo pouzit?<BR><BR>#include
<stdint.h><BR>uint8_t parity(uint8_t b) {<BR> b = b ^ (b
>> 4);<BR> b = b ^ (b >> 2);<BR> b = b ^
(b >> 1);<BR> return b &
1;<BR>}<BR><BR>alebo<BR><BR>const uint8_t nibble_parity[16] = {tabulka parit
4-bitovych nibbles, <BR>nechce sa mi rozpisovat... :-)}<BR><BR>uint8_t
parity(uint8_t b) {<BR> return nibble_parity[b & 0x0F] ^
nibble_parity[b >> 4];<BR>}<BR><BR>pripadne pre
fajnsmekrov<BR><BR>uint8_t parity(uint8_t b) {<BR> return b ?
parity(b >> 1) ^ (b & 1) : b;<BR>}<BR><BR><BR>No ak by islo o '51,
tak je to jednoducho len vytiahnut bit P z PSW...
;-)<BR><BR>wek<BR><BR><BR><BR>Michal HW wrote:<BR>> Zdravim<BR>> nemate
nekdo po ruce funkci pro vypocet paritniho bitu? V cecku. <BR>> Datovy
byte: 7bitu, parita suda.<BR>> <BR>> Diky.<BR>> Michal Gregor<BR>>
_______________________________________________<BR>> HW-list mailing
list - sponsored by <A
href="http://www.HW.cz">www.HW.cz</A><BR>> <A
href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</A><BR>> <A
href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</A><BR>>
<BR>_______________________________________________<BR>HW-list mailing
list - sponsored by <A href="http://www.HW.cz">www.HW.cz</A><BR><A
href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</A><BR><A
href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</A><BR></BLOCKQUOTE></BODY></HTML>