8051 ALP TO CHECK IF THE NUMBER IS POSITIVE OR NEGATIVE

Поділитися
Вставка
  • Опубліковано 14 гру 2024

КОМЕНТАРІ • 7

  • @musicwood4096
    @musicwood4096 3 роки тому

    How should we write the similar program if we're supposed to find positive and negative in an array???

    • @harshabk3863
      @harshabk3863  3 роки тому +1

      Have two registers (pointers):
      One for taking the data from the array (number under test). Another one for saving the status(+ve or -ve).
      Have a counter to check if all the elements in the array have been parsed.
      Follow the process as mentioned in the Video until all the elements in the array have been tested.

  • @sharatkumark3391
    @sharatkumark3391 3 роки тому

    Sir if postive value like 80 the 1st binary digit value will be 1 so this programm fail in this case

    • @harshabk3863
      @harshabk3863  3 роки тому +1

      Thank you for the review dear Sharatkumar.
      Hope this explanation will clear your confusion.
      8051 is a 8 bit microcontroller. Hence the accumulator can take on 2^8 combinations of input that is 256 combinations.
      Depending on the MSB the following the number is said to be:
      Positive if the MSB is 0, that is 00H-7fH
      Negative if the MSB is 1, that is 80H-ffH
      Hence 80H is not a positive number according to the convention used.

  • @tanishnani2003
    @tanishnani2003 3 роки тому

    Sir can I get this ppt please

    • @harshabk3863
      @harshabk3863  3 роки тому +1

      Access it from this link drive.google.com/file/d/1qsmgh0wsw9r1tzjZ2DrVpDJrYgW19ntO/view?usp=sharing

    • @tanishnani2003
      @tanishnani2003 3 роки тому

      @@harshabk3863 thankyou sir