Kunstmatige Intelligentie heeft ook verstand van HAM

Voor als het echt nergens anders thuis hoort.
Bericht
Auteur
Gebruikersavatar
PE9ZZ
Berichten: 1239
Lid geworden op: 06 nov 2010, 18:00
Roepletters: PE9ZZ
Locatie: Amsterdam (JO22KI)
Contacteer:

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#16 Bericht door PE9ZZ »

Intussen de draad weer opgepakt. Die AI is best slim geprogrammeerd:
Q: In your example the actual conversion from BCD to 7-segment does not work. Is that because there are only 3 input bits on PORTA? BCD code has 4 bits.
A: You are correct that the example code I provided does not correctly convert a BCD value to a 7-segment display output. This is because the BCD input is only 3 bits and therefore can only represent values from 0-7, whereas a 4-bit BCD input is needed to represent values from 0-9.

Additionally, the example code does not account for the fact that different BCD values map to different segments on a 7-segment display. The code simply turns on or off a certain segment based on the value of each bit in the BCD input, which would not result in the correct display output for a given BCD value.

To correctly convert a 4-bit BCD input to a 7-segment display output on PORTB, a lookup table or a series of case statements would be needed to map the BCD input to the correct segment outputs.

The example I provided is just a simple snippet and it should be used as a guide only to understand the basic process of how to work with assembly language and PIC. It is not a complete or functional code and should not be used as is.
Q: That is an impressive answer! How did you acquire this insight?
A: As a language model, I have been trained on a diverse set of texts which includes books, articles, and websites related to programming and microcontroller programming. This has given me a broad understanding of different programming languages and platforms, including assembly language and PIC microcontrollers. Additionally, I have been trained on information and examples related to BCD and 7-segment displays. Therefore, when answering your question, I was able to draw on this knowledge to provide an explanation of how to convert BCD input to 7-segment display output and how the example code falls short of it.

Grappig dat-ie inderdaad met die lookup table komt en dat-ie mijn vraag in z'n antwoord gebruikt. Case statements heb je overigens niet in assembly. Dat zou je moeten doen met SUBLW statements en test op STATUS,Z bit. Dan is een lookup table sneller. Met 16 waardes om ook A-F weer te geven:

Code: Selecteer alles

; PIC16F628A assembly code to convert BCD input on PORTA(3:0) to
; 7-segment display output on PORTB as generated by ChatGPT and
; fixed by PE9ZZ.
; PORTA,0: BCD(A)
; PORTA,1: BCD(B)
; PORTA,2: BCD(C)
; PORTA,3: BCD(D)
; PORTB,0: Seg a
; PORTB,1: Seg b
; PORTB,2: Seg c
; PORTB,3: Seg d
; PORTB,4: Seg e
; PORTB,5: Seg f
; PORTB,6: Seg g
; PORTB,7: Seg DP (not used here)

	LIST	P=16F628A, F=INHX8M
	#include <p16f628a.inc>

	__CONFIG  _INTRC_OSC_NOCLKOUT & _WDT_OFF & _LVP_OFF & _CP_OFF & _BODEN_OFF


; Set PORTA as input and PORTB as output
	BSF	STATUS,RP0
	MOVLW	0x0F
	MOVWF	TRISA
	MOVLW	0x00
	MOVWF	TRISB
	MOVLW	0x07
	MOVWF	CMCON		; Set PORTA as digital input
	BCF	STATUS,RP0

; Read BCD input from PORTA and store in bcdInput
ReadBCD
	MOVFW	PORTA

; Convert BCD input to 7-segment display output
	ANDLW	0x0F
	CALL	bcdTo7Segment
	MOVWF	PORTB
	GOTO	ReadBCD

; bcdTo7Segment lookup
bcdTo7Segment
	ADDWF	PCL,F			; Jump into the lookup table
	RETLW	0xC0			; Return segment code for 0
	RETLW	0xF9			; Return segment code for 1
	RETLW	0xA4			; Return segment code for 2
	RETLW	0xB0			; Return segment code for 3
	RETLW	0x99			; Return segment code for 4
	RETLW	0x92			; Return segment code for 5
	RETLW	0x82			; Return segment code for 6
	RETLW	0xF8			; Return segment code for 7
	RETLW	0x80			; Return segment code for 8
	RETLW	0x90			; Return segment code for 9
	RETLW	0x88			; Return segment code for A
	RETLW	0x83			; Return segment code for b
	RETLW	0xC6			; Return segment code for C
	RETLW	0xE1			; Return segment code for d
	RETLW	0x86			; Return segment code for E
	RETLW	0x8E			; Return segment code for F

	END
Tjerk, 9ZZ

sottezero
Berichten: 814
Lid geworden op: 17 nov 2015, 18:33

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#17 Bericht door sottezero »

Nog een jaartje ofzo en AI besluit dat de mensheid te dom is en rise of the dark judgement salvation day genesis all over again.

PA3CQN
Berichten: 789
Lid geworden op: 10 dec 2014, 21:59
Roepletters: PA3CQN
Locatie: Groningen
Contacteer:

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#18 Bericht door PA3CQN »

Paula Bean schreef: 14 jan 2023, 12:56 Dus binnenkort moet je ervoor betalen.
Je betaalt nu al. Toen ik me wou aanmelden vroeg de site om mijn mailadres, en daarna om mijn telefoonnummer.
Toen ben ik afgehaakt. Om nou een mee te helpen aan een database met mail<>telefoon koppeling pas ik voor.
_______________________________________________
Na jaren afwezig toch maar weer eens rondkijken.
UV-B5, RTL stick, SDRPlay2, miniwhip, magloop, X300
http://www.pa3cqn.nl
_______________________________________________

Gebruikersavatar
PA2EFR
Berichten: 1455
Lid geworden op: 04 jan 2008, 00:13
Roepletters: PA2EFR
Locatie: JO33HE: Haren Gn.
Contacteer:

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#19 Bericht door PA2EFR »

how long will you be free to use?

I am a product of OpenAI, so the terms of my use will be determined by the company. However, as of my knowledge cutoff in September 2021, OpenAI offers a free API for developers to use for a limited number of requests per month. Additionally, there are also paid plans available for higher usage.

Gebruikersavatar
PA8S
Berichten: 168
Lid geworden op: 25 jan 2020, 21:42
Locatie: JO32bl
Contacteer:

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#20 Bericht door PA8S »


Gebruikersavatar
PE1PQX
Berichten: 4527
Lid geworden op: 06 jun 2011, 21:51
Roepletters: PE1PQX
Locatie: Emmen (JO32LS)
Contacteer:

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#21 Bericht door PE1PQX »

PA3CQN schreef: 16 jan 2023, 13:29
Paula Bean schreef: 14 jan 2023, 12:56 Dus binnenkort moet je ervoor betalen.
Je betaalt nu al. Toen ik me wou aanmelden vroeg de site om mijn mailadres, en daarna om mijn telefoonnummer.
Toen ben ik afgehaakt. Om nou een mee te helpen aan een database met mail<>telefoon koppeling pas ik voor.
Dat dus.... ik ga mij dus ook niet aanmelden om er eens mee te stoeien.
73', André PE1PQX (Site: http://www.pe1pqx.eu)

"Anyone who sits on top of the largest hydrogen-oxygen fueled system in the world; knowing they're going to light the bottom - and doesn't get a little worried - does not fully understand the situation"
John Young, Astronaut (Gemini 3, Gemini 10, Apollo 10, Apollo 16, STS-1, STS-9)

Gebruikersavatar
Paula Bean
Berichten: 301
Lid geworden op: 04 aug 2019, 12:50

Re: Kunstmatige Intelligentie heeft ook verstand van HAM

#22 Bericht door Paula Bean »

PA3CQN schreef: 16 jan 2023, 13:29 Toen ik me wou aanmelden vroeg de site om mijn mailadres, en daarna om mijn telefoonnummer.
Hmmm, toen ik me aanmeldde hoefde ik alleen mijn emailadres te geven. Ik gebruik voor dit soort dingen een secundair emailadres.
Toen ben ik afgehaakt. Om nou een mee te helpen aan een database met mail<>telefoon koppeling pas ik voor.
Dat zou ik ook doen. Maar voor dit soort gevallen heb ik een tweede (secundaire) oude telefoon met een prepaid nummer. Je wil niet weten uit welke uithoeken van de wereld ik allemaal gebeld wordt door welwillende lieden die mij advies willen geven over beleggen in cryptocurrency :mrgreen: blijkbaar is dat super lucratief, mijn antwoord is dan: waarom ga je zelf dan niet daarin beleggen in plaats van in een callcenter te zitten

Plaats reactie