Bcd

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Bcd as PDF for free.

More details

  • Words: 245
  • Pages: 3
HEÄ THOÁNG SOÁ BCD Binary Coded Decimal

Ñònh nghóa: Trong heä thoáng soá BCD, ngöôøi ta söû duïng maõ nhò phaân ñeå bie dieãn caùc soá trong heä thaäp phaân Ví duï: bieåu dieãn soá BCD

4 18 5

BCD

0100 0001 1000 0101 B 0100 0001 1000 0101 B

418 5 BCD

4185h

BCD TRONG VI XÖÛ LYÙ 8051 Duøng leänh: DA A ( Decimal Adjust Accumulator) Quy taéc chuyeån: Böôùc 1: xeùt nibble thaáp -Neáu nibble thaáp ≤ 9 thì AC = 0 vaø qua böôùc 2. -Neáu nibble thaáp > 9 thì:  coäng theâm 6 vaøo nibble thaáp, caát nibble thaáp cuûa keát quaû vaøo nibble thaáp cuûa A.  baät côø AC leân 1.  qua böôùc 2. Böôùc 2: xeùt nibble cao -Coäng nibble cao cuûa A vôùi côø AC. -Neáu nibble cao cuûa keát quaû ≤ 9 thì caát noù vaøo nibble cao cuûa A. -Neáu nibble cao cuûa keát quaû > 9 thì:  coäng theâm 6 vaøo nibble cao cuûa keát quaû, caát nibble thaáp cuûa keát quaû sau coäng vaøo A.  baät côø C leân 1.

BCD TRONG VI XÖÛ LYÙ 8051 Ví duï: Tröôùc khi thöïc hieän leänh:

A=

9

A

h

Khi thöïc hieän leänh DA A:

A=

9

A

h Ah > 9 ⇒ Ah+6 = 10h

kq = Ah > 9 ⇓ kq + 6 = 10h

AC = 1

Sau khi thöïc hieän leänh: C=1

A=

0 0

h

Related Documents

Bcd
November 2019 4
Bcd
December 2019 7
Passportnoc Bcd
November 2019 5
03_detektor Bcd
May 2020 6
090409 Bcd Design Is
April 2020 5