ÀÎÅÚÆÀÀÌ ±Ç°íÇÑ KSC Floating Point Standard¸¦ IEEE°¡ äÅÃÇÑ format ÀÌ´Ù.
C/C++ ¿¡¼ float, double typeÀ¸·Î ¾²ÀÌ´Â real number¸¦ Ç¥ÇöÇϱâÀ§ÇÑ binary format.
¿ì¼± single precision format (floatÇü) À¸·Î ÇϳªÀÇ data¸¦ Ç¥ÇöÇϱâ32bit¸¦ »ç¿ëÇϸç
±× Æ÷¸ËÀº high order·Î ´ÙÀ½°ú °°´Ù.
1bit(sign bit)-8bit(exponent)-23bit(mantissa)
dobule precision format(dobule)Àº 64bit¸¦ »ç¿ëÇÏ¸ç ±×Æ÷¸ËÀº
1bit(sign bit)-11bit(exponent)-52bit(mantissa) ÀÌ´Ù.
1. sign bit : °ªÀÌ ¾øÀ¸¸é +À̰í ÀÖÀ¸¸é -
2. exponent: 2¿¡ ´ëÇÑ ½Â¼ö (single -127, dobule -1023 ÀÌ base)
3. mantissa: precision À» ³ªÅ¸³»´Â °¡¼ö. 1<=mantissa<2ÀÇ °ªÀ» °¡Áö¸ç Á¤¼öºÎ´Â
Ç×»ó 1À̹ǷΠ»ý·«ÇÏ°í ¼Ò¼öºÎ¸¸À» 2Áø¹ýÀ¸·Î Ç¥ÇöÇÑ´Ù.
°¡·É 1.0f ¿¡ ´ëÇÑ single precision floatÇüÀÇ binary level Ç¥Çö ¹æ¹ýÀº
1.0f = (+) 1.0 X (2ÀÇ 0½Â) À̹ǷÎ
sign bit´Â 0
exponent´Â 127 (-127ÀÌ base)
mantissa´Â 1.0(10Áø¹ý), 1.0(2Áø¹ý) (¼Ò¼öºÎ´Â 0 Á¤¼öºÎ´Â »ý·«ÇÔ) ÇØ¼
0_01111111_00000000000000000000000
·Î Ç¥ÇöµÉ ¼ö ÀÖ´Ù.
-3.0f µµ ¿¹¸¦ µé¸é
-3.0f= (-) 1.5 X (2ÀÇ 1½Â) À̹ǷÎ
sign bit´Â 1
exponent´Â 128 (-127ÀÌ base)
mantissa´Â 1.5(10Áø¹ý) 1.1(2Áø¹ý) (¼Ò¼öºÎ 1)
1_10000000_10000000000000000000000
3.141592X(10ÀÇ 15)½ÂÀÇ ¿¹
1.39515 X (2ÀÇ 51½Â) À̹ǷÎ
sign bit´Â 0
exponent´Â 178 (-127ÀÌ base)
matissa´Â 1.39515(10Áø¹ý) 1.0110010100101000010111(2Áø¹ý)
0_10110010_01100101001010000101110
======================================================
½ÇÁ¦·Î ±×·±Áö È®ÀÎÇÒ ¼ö ÀÖ´Â example c++ÄÚµåÀÌ´Ù.
=================================
typedef unsigned long UINT32;
typedef unsigned char UINT8;
typedef struct tagFloat
{
UINT32 mantissa:23;
UINT32 exponent:8;
UINT32 sign:1;
} * FLOATPTR;
int example(float f)
{
UINT8 * fp = (UINT8 *) &f;
cout << "Floating Value : " << fixed << f << endl;
for (int i = 3; i >=0 ; i--)
{
for (int j = 7; j >=0; j--)
{
if (fp[i] & (1 << j))
{
cout << "1";
}
else
{
cout << "0";
}
}
cout << " ";
}
cout << endl;
FLOATPTR fpinfo = (FLOATPTR) &f;
cout << "Sign : " << fpinfo->sign << endl;
cout << "Exponent : " << fpinfo->exponent - 127 << endl;
cout << "Mantissa : " << ((float)fpinfo->mantissa /(float)(1 << 23)) + 1 << endl;
return 0;
} |
|
À©µµ¿ì¿¡¼ ¿ÜºÎÀåÄ¡³ª Àåºñ¸¦ ÄÁÆ®·Ñ ÇÏ´Â ³×Æ®¿öÅ© ¹æ¹ýÀ¸·Î
RS-232 Serial Interface°¡ ³Î¸® »ç¿ëµÈ´Ù.
COM1-COM4°¡ dos½ÃÀýºÎÅÍ traditionalÇÏ°Ô serial port·Î ÀâÇôÀÖ°í
USBµî Çϵå¿þ¾î º¥´õ³ª µð¹ÙÀ̽º µå¶óÀ̹ö °³¹ßÀÚ°¡ Serial Interface¸¦ Á¦°øÇϸé ÀÓÀÇ´ë·Î Æ÷Æ®¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.
À©µµ¿ì¿¡¼ ½Ã¸®¾ó ÀÎÅÍÆäÀ̽º¸¦ ÅëÇØ µ¥ÀÌÅ͸¦ ÁÖ°í ¹Þ±â À§Çؼ±
File I/O °ü·Ã API°¡ °ø¿ëÀ¸·Î »ç¿ëµÈ´Ù.
CreateFile()·Î COM Æ÷Æ®¸¦ ¿¾î Ä¿³Ø¼ÇÇÚµéÀ» ¾ò°í
CloseHandle()·Î ¿¸° ÇÚµéÀ» ´Ý´Â µî file operation°ú µ¿ÀÏÇÏ´Ù
Data I/O¸¦ À§Çؼµµ File operation°ú µ¿ÀÏÇÏ°Ô ReadFile(), WriteFile()À» »ç¿ë¸ç Synchronous mode°ú Asynchronous mode µÎ °¡Áö·Î IO Çڵ鸵ÀÌ °¡´ÉÇÏ´Ù.
AsyncÀü¿ëÀ¸·Î ReadFileEx()¿Í WriteFileEx() »ç¿ëµµ °¡´ÉÇÏ´Ù.
Serial Communication¿¡¼ Nonblocking ¸ðµå·Î IO¸¦ °ü¸®ÇÏ´Â ¹æ¹ýÀº 2°¡Áö°¡ ÀÖ´Ù.
1. ÀÏ¹Ý synchronous IO mode·Î ÇÚµéÀ» »ý¼ºÇϰí, SetCommTimeout()À» nonblockÀ¸·Î ¼³Á¤Çϸé IO°¡ nonblockingµÈ´Ù. À̶§ SetCommMask(), WaitCommEvent()¸¦ ÀÌ¿ëÇØ À̺¥Æ® ó¸®ÇÑ´Ù.
2. CreateFile()½Ã overlapped flag¸¦ »ç¿ëÇØ asynchronous IO mode·Î ÇÚµéÀ» »ý¼ºÇϰí ReadFile(), WriteFile()»ç¿ëÇÒ ¶§ overlapped structure¿¡ event object¸¦ create, setÇØ¼ parameter·Î ³Ñ±â¸é nonblockµÈ´Ù. ±×·± ÈÄ overlapped structureÀÇ event object°¡ set µÇ´Â ŸÀÓÀ» waitÇØÁà ó¸®ÇÑ´Ù. À̺¥Æ®°¡ ¹ß»ýÇϸé GetOverlappedResult()¸¦ »ç¿ëÇØ ½ÇÁ¦ IOó¸®µÈ µ¥ÀÌÅͱæÀ̸¦ °¡Á®¿Â´Ù. ReadFileEx(), WriteFileEx() ¿¡ overlapped completion routineÀ» »ç¿ëÇÏ´Â ¹æ¹ýµµ ÀÖ´Ù. |
|
À©µµ¿ì ¿î¿µÃ¼Á¦´Â ¼ö¸¹Àº À©µµ¿ì·Î ±¸¼ºµÇ¾î ÀÖÀ¸¸ç
µ¥½ºÆ®Å¾À©µµ¿ì¿¡¼ Parent-Child, Z-orderÀÇ Æ®¸®±¸Á¶¸¦ °¡Áö°í ÀÖ´Ù.
ƯÁ¤ ºÎ·ùÀÇ ¾îÇø®ÄÉÀ̼ÇÀ̳ª À©µµ¿ìµéÀ» ÄÁÆ®·Ñ Çϱâ À§Çؼ±
ÀÌ º¹ÀâÇÑ Æ®¸®±¸Á¶¿¡¼ ¾ó¸¶³ª È¿À²ÀûÀ¸·Î Á¤È®ÇÏ°Ô ³»°¡ ¿øÇÏ´Â À©µµ¿ì ÇÚµéÀ» ã´À³Ä°¡ Áß¿äÇÏ´Ù.
1. Ŭ·¡½º³×ÀÓÀ̳ª À©µµ¿ì³×ÀÓ È¤Àº µÑ ¸ðµÎÀÇ Á¤º¸¸¦ ¾Ë°í ÀÖ´Ù¸é FindWindow() ¸¦ Ȱ¿ëÇÑ´Ù.
2. À©µµ¿ìÂ÷ÀÏµåÆ®¸®Å½»öÀº GetWindow()·Î °¡´ÉÇÏÁö¸¸EnumChildWindows()°¡ º¸´Ù ¾ÈÀüÇÏ´Ù.
3. Top-level À©µµ¿ì Ž»öÀº EnumWindows() ·Î °¡´ÉÇϸç
EnumWindowsProc³»¿¡¼ °¢Á¾ Á¶°ÇÀ¸·Î ÇÊÅ͸µ°¡´ÉÇÏ´Ù
ÇÊÅ͸µ ÇÒ¶§ ÁÖ·Î ¾²ÀÌ´Â ¹æ¹ýÀº
GetWindowLong()À» ÀÌ¿ëÇÑ Æ¯Á¤ Style, ExStyleÀÇ AND °Ë»ç¿Í
GetWindowText()·Î Title³×ÀÓÀ̳ª À©µµ¿ì ÅØ½ºÆ® Á¶»ç,
GetClassName() À¸·Î À©µµ¿ìŬ·¡½º¸¦ Á¶»çÇØº¸´Â ¹æ¹ýÀÌ ÀÖ´Ù.
Spy++ ÅøÀÇ µµ¿òÀ» ¹Þ´Â °Íµµ À¯¿ëÇÏ´Ù. |
|
|
 |
|
¢Æ °Ë»ö
¢Æ Ä«Å×°í¸®
¢Æ ¹æ¹®ÀÚ Áý°è
Àüü 542929 ¸í
¿À´Ã 168 ¸í
¾îÁ¦ 304 ¸í
¢Æ ±Û º¸°üÇÔ
¢Æ ´Þ·Â
| S |
M |
T |
W |
T |
F |
S |
| 30 | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 29 | 30 | 31 | 1 | 2 | 3 |
|
¢Æ ÃÖ±Ù¿¡ ¿Ã¶ó¿Â ±Û
¢Æ ÃÖ±Ù¿¡ ´Þ¸° ´ñ±Û
¢Æ ÃÖ±Ù¿¡ ¹ÞÀº Æ®·¢¹é
¢Æ ¸µÅ© »çÀÌÆ®
|